pear-electron 1.4.5 → 1.4.7

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.
Files changed (2) hide show
  1. package/package.json +2 -2
  2. package/runtime.js +7 -7
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pear-electron",
3
- "version": "1.4.5",
3
+ "version": "1.4.7",
4
4
  "description": "Pear User-Interface Library for Electron",
5
5
  "main": "index.js",
6
6
  "bin": "bin.js",
@@ -19,7 +19,7 @@
19
19
  ],
20
20
  "pear": {
21
21
  "name": "pear-electron",
22
- "bootstrap": "pear://0.2625.yceb7sjhgfzsnza7oc38hy3oxu9dhnywi3mzxdm9ubc48kjnxqgo",
22
+ "bootstrap": "pear://0.2627.yceb7sjhgfzsnza7oc38hy3oxu9dhnywi3mzxdm9ubc48kjnxqgo",
23
23
  "stage": {
24
24
  "skipWarmup": "true",
25
25
  "only": [
package/runtime.js CHANGED
@@ -17,10 +17,10 @@ const run = require('pear-api/cmd/run')
17
17
  const pear = require('pear-api/cmd')
18
18
  const pkg = require('./package.json')
19
19
 
20
- const bin = () => {
21
- const name = Pear.config.name[0].toUpperCase() + Pear.config.name.slice(1)
22
- const app = isMac ? name + ' Runtime.app' : Pear.config.name + '-runtime-app'
23
- const exe = isWindows ? name + 'Runtime.exe' : (isMac ? 'Contents/MacOS/' + name + ' Runtime' : Pear.config.name + '-runtime')
20
+ const bin = (name = Pear.config.name) => {
21
+ const formatedName = name[0].toUpperCase() + name.slice(1)
22
+ const app = isMac ? formatedName + ' Runtime.app' : name + '-runtime-app'
23
+ const exe = isWindows ? formatedName + 'Runtime.exe' : (isMac ? 'Contents/MacOS/' + formatedName + ' Runtime' : name + '-runtime')
24
24
  return isWindows ? 'bin\\' + app + '\\' + exe : (isMac ? 'bin/' + app + '/' + exe : 'bin/' + app + '/' + exe)
25
25
  }
26
26
 
@@ -70,14 +70,14 @@ class PearElectron {
70
70
  async #asset (opts, force = false) {
71
71
  const output = outputter('asset', this.#outs())
72
72
  const json = false
73
- const bootstrap = opts.bootstrap ?? pkg.pear.bootstrap
74
- const executable = opts.bootstrap ? bin() : BIN
73
+ const bootstrap = opts.bootstrap?.link ?? opts.bootstrap ?? pkg.pear.bootstrap
74
+ const executable = opts.bootstrap ? bin(opts.bootstrap.name) : BIN
75
75
  const stream = Pear.asset(bootstrap, {
76
76
  only: ['/boot.bundle', '/by-arch/' + require.addon.host, '/prebuilds/' + require.addon.host],
77
77
  force
78
78
  })
79
79
  const asset = await output(json, stream)
80
- if (asset === null) throw new Error('Failed to determine runtime asset from sidecar')
80
+ if (asset === null || !asset?.path) throw new Error('Failed to determine runtime asset from sidecar')
81
81
  return path.join(asset.path, 'by-arch', require.addon.host, executable)
82
82
  }
83
83