mirror of
https://github.com/quine-global/hyper.git
synced 2026-01-15 21:28:40 -09:00
CLI: use .hyper.js from repo root dir when running in dev mode (#2792)
This commit is contained in:
parent
57c735cb6d
commit
b5c221fe68
2 changed files with 16 additions and 1 deletions
9
.vscode/launch.json
vendored
9
.vscode/launch.json
vendored
|
|
@ -8,6 +8,15 @@
|
||||||
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/electron",
|
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/electron",
|
||||||
"program": "${workspaceRoot}/app/index.js",
|
"program": "${workspaceRoot}/app/index.js",
|
||||||
"protocol": "inspector"
|
"protocol": "inspector"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "node",
|
||||||
|
"request": "launch",
|
||||||
|
"name": "cli",
|
||||||
|
"runtimeExecutable": "node",
|
||||||
|
"program": "${workspaceRoot}/bin/cli.js",
|
||||||
|
"args": ["--help"],
|
||||||
|
"protocol": "inspector"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,8 +4,14 @@ const got = require('got');
|
||||||
const registryUrl = require('registry-url')();
|
const registryUrl = require('registry-url')();
|
||||||
const pify = require('pify');
|
const pify = require('pify');
|
||||||
const recast = require('recast');
|
const recast = require('recast');
|
||||||
|
const path = require('path');
|
||||||
|
|
||||||
const fileName = `${os.homedir()}/.hyper.js`;
|
const devConfigFileName = path.join(__dirname, `../.hyper.js`);
|
||||||
|
|
||||||
|
let fileName =
|
||||||
|
process.env.NODE_ENV !== 'production' && fs.existsSync(devConfigFileName)
|
||||||
|
? devConfigFileName
|
||||||
|
: `${os.homedir()}/.hyper.js`;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* We need to make sure the file reading and parsing is lazy so that failure to
|
* We need to make sure the file reading and parsing is lazy so that failure to
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue