diff --git a/lib/core/fs.js b/lib/core/fs.js index ccfe40e1..cb52d591 100644 --- a/lib/core/fs.js +++ b/lib/core/fs.js @@ -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() {