fallback to shelljs if pwd is empty (windows issue)

This commit is contained in:
Iuri Matias 2018-03-26 14:54:47 -04:00
parent 0b7a33f835
commit 4b0925d425
2 changed files with 7 additions and 2 deletions

View File

@ -32,7 +32,7 @@ class SolcW {
if (err) {
return done(err);
}
let requirePath = utils.joinPath(process.env.PWD, location);
let requirePath = utils.joinPath(utils.pwd(), location);
solcProcess.send({action: 'loadCompiler', solcLocation: requirePath});
});

View File

@ -123,6 +123,10 @@ function proposeAlternative(word, _dictionary, _exceptions) {
return propose(word, dictionary, {threshold: 0.3});
}
function pwd() {
return process.env.PWD || shelljs.pwd();
}
module.exports = {
joinPath: joinPath,
filesMatchingPattern: filesMatchingPattern,
@ -138,5 +142,6 @@ module.exports = {
exit: exit,
downloadFile: downloadFile,
extractTar: extractTar,
proposeAlternative: proposeAlternative
proposeAlternative: proposeAlternative,
pwd: pwd
};