anchor fs.dappPath, fs.embarkPath to env vars setup in cmd.js
This commit is contained in:
parent
b7fd109237
commit
019f0b68c8
|
@ -78,11 +78,23 @@ function removeSync() {
|
|||
}
|
||||
|
||||
function embarkPath() {
|
||||
return utils.joinPath(__dirname, '/../../', ...arguments);
|
||||
const _embarkPath = process.env.EMBARK_PATH;
|
||||
if (!_embarkPath) {
|
||||
const errMsg = 'process.env.EMBARK_PATH was not set'.bold.red;
|
||||
console.error(errMsg);
|
||||
process.exit(1);
|
||||
}
|
||||
return utils.joinPath(_embarkPath, ...arguments);
|
||||
}
|
||||
|
||||
function dappPath() {
|
||||
return utils.joinPath(utils.pwd(), ...arguments);
|
||||
const _dappPath = process.env.DAPP_PATH;
|
||||
if (!_dappPath) {
|
||||
const errMsg = 'process.env.DAPP_PATH was not set'.bold.red;
|
||||
console.error(errMsg);
|
||||
process.exit(1);
|
||||
}
|
||||
return utils.joinPath(_dappPath, ...arguments);
|
||||
}
|
||||
|
||||
function createWriteStream() {
|
||||
|
|
Loading…
Reference in New Issue