pear-build 0.1.2 → 0.2.0
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/index.js +6 -2
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -45,16 +45,20 @@ module.exports = async function build(dir, opts = {}) {
|
|
|
45
45
|
androidArm64
|
|
46
46
|
].filter(Boolean)
|
|
47
47
|
|
|
48
|
+
const appName = pkg.productName ?? pkg.name
|
|
49
|
+
|
|
48
50
|
const noop = () => {}
|
|
49
51
|
const promises = []
|
|
50
52
|
for (const [arch, app] of apps) {
|
|
51
|
-
|
|
53
|
+
if (path.basename(app, path.extname(app)) !== appName) {
|
|
54
|
+
throw new Error(`expected directory ${appName} but got ${path.basename(app)} for ${arch}`)
|
|
55
|
+
}
|
|
52
56
|
const archApp = path.join(byArch, arch, 'app')
|
|
53
57
|
await fs.promises.mkdir(archApp, { recursive: true })
|
|
54
58
|
|
|
55
59
|
const src = new Localdrive(path.dirname(app))
|
|
56
60
|
const dst = new Localdrive(archApp)
|
|
57
|
-
const mirror = src.mirror(dst, { prefix: '/' +
|
|
61
|
+
const mirror = src.mirror(dst, { prefix: '/' + path.basename(app) })
|
|
58
62
|
|
|
59
63
|
await src.ready()
|
|
60
64
|
await dst.ready()
|