pear-build 1.3.0 → 1.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin.js +3 -0
- package/index.js +3 -1
- package/package.json +1 -1
package/bin.js
CHANGED
|
@@ -7,6 +7,9 @@ const cmd = command(pkg.name, pkg.command, async function (cmd) {
|
|
|
7
7
|
if (cmd.flags.version) return console.log(`v${pkg.version}`)
|
|
8
8
|
try {
|
|
9
9
|
const runner = build(cmd.flags)
|
|
10
|
+
runner.on('building', ({ message, pkg, target }) =>
|
|
11
|
+
console.log(`${message} ${pkg.name} (v${pkg.version}) into ${target}`)
|
|
12
|
+
)
|
|
10
13
|
runner.on('mirrored', (data) => console.log(data.from, data.message, data.to))
|
|
11
14
|
runner.on('error', (err) => console.error(err))
|
|
12
15
|
await runner.done()
|
package/index.js
CHANGED
|
@@ -23,6 +23,8 @@ class Build extends EventEmitter {
|
|
|
23
23
|
const config = configPath && (await getParsedJSON('pear.json', configPath))
|
|
24
24
|
|
|
25
25
|
const { target = path.resolve(pkg.name + '-' + pkg.version) } = opts
|
|
26
|
+
this.emit('building', { message: 'Building', pkg, target })
|
|
27
|
+
|
|
26
28
|
const archs = {
|
|
27
29
|
'darwin-arm64': opts.darwinArm64App,
|
|
28
30
|
'darwin-x64': opts.darwinX64App,
|
|
@@ -67,7 +69,7 @@ class Build extends EventEmitter {
|
|
|
67
69
|
const promises = []
|
|
68
70
|
for (const [arch, app] of apps) {
|
|
69
71
|
if (!fs.existsSync(app)) {
|
|
70
|
-
throw new
|
|
72
|
+
throw new ERR_NOT_FOUND(`${app} does not exist`)
|
|
71
73
|
}
|
|
72
74
|
if (appNames.includes(path.basename(app, path.extname(app))) === false) {
|
|
73
75
|
throw ERR_INVALID_APP_NAME(
|