@holochain/hc-spin 0.400.0-dev.0 → 0.400.0-dev.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.
Files changed (3) hide show
  1. package/cli/cli.js +16 -13
  2. package/dist/cli.js +16 -13
  3. package/package.json +1 -1
package/cli/cli.js CHANGED
@@ -3,20 +3,23 @@ const { spawn } = require('child_process');
3
3
  const path = require('path');
4
4
  const fs = require('fs');
5
5
 
6
- let electronBinary;
7
- let pathStr =
8
- process.platform === 'win32'
9
- ? '../node_modules/electron/dist/electron.exe'
10
- : '../node_modules/.bin/electron';
6
+ let electronBinary = process.env.ELECTRON_BINARY;
11
7
 
12
- // recursively look for electron binary in node_modules folder
13
- for (let i = 0; i < 7; i++) {
14
- const maybeElectronBinary = path.resolve(__dirname, pathStr);
15
- if (fs.existsSync(maybeElectronBinary)) {
16
- electronBinary = maybeElectronBinary;
17
- break;
18
- } else {
19
- pathStr = '../' + pathStr;
8
+ if (!electronBinary) {
9
+ let pathStr =
10
+ process.platform === 'win32'
11
+ ? '../node_modules/electron/dist/electron.exe'
12
+ : '../node_modules/.bin/electron';
13
+
14
+ // recursively look for electron binary in node_modules folder
15
+ for (let i = 0; i < 7; i++) {
16
+ const maybeElectronBinary = path.resolve(__dirname, pathStr);
17
+ if (fs.existsSync(maybeElectronBinary)) {
18
+ electronBinary = maybeElectronBinary;
19
+ break;
20
+ } else {
21
+ pathStr = '../' + pathStr;
22
+ }
20
23
  }
21
24
  }
22
25
 
package/dist/cli.js CHANGED
@@ -3,20 +3,23 @@ const { spawn } = require('child_process');
3
3
  const path = require('path');
4
4
  const fs = require('fs');
5
5
 
6
- let electronBinary;
7
- let pathStr =
8
- process.platform === 'win32'
9
- ? '../node_modules/electron/dist/electron.exe'
10
- : '../node_modules/.bin/electron';
6
+ let electronBinary = process.env.ELECTRON_BINARY;
11
7
 
12
- // recursively look for electron binary in node_modules folder
13
- for (let i = 0; i < 7; i++) {
14
- const maybeElectronBinary = path.resolve(__dirname, pathStr);
15
- if (fs.existsSync(maybeElectronBinary)) {
16
- electronBinary = maybeElectronBinary;
17
- break;
18
- } else {
19
- pathStr = '../' + pathStr;
8
+ if (!electronBinary) {
9
+ let pathStr =
10
+ process.platform === 'win32'
11
+ ? '../node_modules/electron/dist/electron.exe'
12
+ : '../node_modules/.bin/electron';
13
+
14
+ // recursively look for electron binary in node_modules folder
15
+ for (let i = 0; i < 7; i++) {
16
+ const maybeElectronBinary = path.resolve(__dirname, pathStr);
17
+ if (fs.existsSync(maybeElectronBinary)) {
18
+ electronBinary = maybeElectronBinary;
19
+ break;
20
+ } else {
21
+ pathStr = '../' + pathStr;
22
+ }
20
23
  }
21
24
  }
22
25
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@holochain/hc-spin",
3
- "version": "0.400.0-dev.0",
3
+ "version": "0.400.0-dev.1",
4
4
  "holochainVersion": "0.4.0-dev.1",
5
5
  "description": "CLI to run Holochain aps during development.",
6
6
  "author": "matthme",