mirror of https://github.com/embarklabs/embark.git
refactor to use dappPath
This commit is contained in:
parent
10f7d21f81
commit
e0db5ed61a
|
@ -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(utils.pwd(), location));
|
||||
return next(null, fs.dappPath(location));
|
||||
});
|
||||
}
|
||||
});
|
||||
|
|
|
@ -50,8 +50,8 @@ function embarkPath(fileOrDir) {
|
|||
return utils.joinPath(__dirname, '/../../', fileOrDir);
|
||||
}
|
||||
|
||||
function dappPath() {
|
||||
return utils.pwd();
|
||||
function dappPath(path) {
|
||||
return utils.joinPath(utils.pwd(), path || "");
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
|
|
|
@ -84,7 +84,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(utils.pwd(), location));
|
||||
self.embark.registerImportFile("ipfs-api", fs.dappPath(location));
|
||||
});
|
||||
}
|
||||
});
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
let utils = require('../../utils/utils.js');
|
||||
let fs = require('../../core/fs.js');
|
||||
let solcProcess;
|
||||
let compilerLoaded = false;
|
||||
let currentSolcVersion = require('../../../package.json').dependencies.solc;
|
||||
|
@ -32,7 +33,7 @@ class SolcW {
|
|||
if (err) {
|
||||
return done(err);
|
||||
}
|
||||
let requirePath = utils.joinPath(utils.pwd(), location);
|
||||
let requirePath = fs.dappPath(location);
|
||||
solcProcess.send({action: 'loadCompiler', solcLocation: requirePath});
|
||||
});
|
||||
|
||||
|
|
|
@ -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(utils.pwd(), location));
|
||||
return next(null, fs.dappPath(location));
|
||||
});
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue