fallback to shelljs if pwd is empty (windows issue)

This commit is contained in:
Iuri Matias 2018-03-26 15:08:07 -04:00
parent 4b0925d425
commit d5a21d579c
5 changed files with 6 additions and 6 deletions

View File

@ -284,7 +284,7 @@ class CodeGenerator {
return next(null, utils.joinPath(fs.embarkPath("js/web3-1.0.min.js")));
} else {
self.events.request("version:getPackageLocation", "web3", web3Version, function(err, location) {
return next(null, utils.joinPath(process.env.PWD, location));
return next(null, utils.joinPath(utils.pwd(), location));
});
}
});

View File

@ -51,7 +51,7 @@ function embarkPath(fileOrDir) {
}
function dappPath() {
return process.env.PWD;
return utils.pwd();
}
module.exports = {

View File

@ -46,7 +46,7 @@ Plugins.prototype.loadInternalPlugin = function(pluginName, pluginConfig) {
};
Plugins.prototype.loadPlugin = function(pluginName, pluginConfig) {
var pluginPath = utils.joinPath(process.env.PWD, 'node_modules', pluginName);
var pluginPath = utils.joinPath(utils.pwd(), 'node_modules', pluginName);
var plugin = require(pluginPath);
var pluginWrapper = new Plugin({name: pluginName, pluginModule: plugin, pluginConfig: pluginConfig, logger: this.logger, pluginPath: pluginPath, interceptLogs: this.interceptLogs, events: this.events, config: this.config, isInternal: false});

View File

@ -80,7 +80,7 @@ class IPFS {
let currentIpfsApiVersion = require('../../../package.json').dependencies["ipfs-api"];
if (ipfsApiVersion !== currentIpfsApiVersion) {
self.events.request("version:getPackageLocation", "ipfs-api", ipfsApiVersion, function(err, location) {
self.embark.registerImportFile("ipfs-api", utils.joinPath(process.env.PWD, location));
self.embark.registerImportFile("ipfs-api", utils.joinPath(utils.pwd(), location));
});
}
});

View File

@ -63,7 +63,7 @@ class Pipeline {
},
function changeCwd(next) {
realCwd = process.env.PWD;
realCwd = utils.pwd();
process.chdir(fs.embarkPath(''));
next();
},
@ -285,7 +285,7 @@ class Pipeline {
return next(null, utils.joinPath(fs.embarkPath("js/web3-1.0.min.js")));
} else {
self.events.request("version:getPackageLocation", "web3", web3Version, function(err, location) {
return next(null, utils.joinPath(process.env.PWD, location));
return next(null, utils.joinPath(utils.pwd(), location));
});
}
});