fix build process on windows

This commit is contained in:
Jonathan Rainville 2018-04-09 16:14:07 -04:00
parent 5a91b2d44a
commit f37b09a371
3 changed files with 11 additions and 0 deletions

View File

@ -289,6 +289,7 @@ class CodeGenerator {
});
},
function getImports(web3Location, next) {
web3Location = web3Location.replace(/\\/g, '/'); // Import paths must always have forward slashes
code += "\nimport Web3 from '" + web3Location + "';\n";
code += "\nimport web3 from 'Embark/web3';\n";
next();

View File

@ -3,6 +3,15 @@ let async = require('async');
require('colors');
// Override process.chdir so that we have a partial-implementation PWD for Windows
const realChdir = process.chdir;
process.chdir = (...args) => {
if (!process.env.PWD) {
process.env.PWD = process.cwd();
}
realChdir(...args);
};
let Engine = require('./core/engine.js');
let version = require('../package.json').version;

View File

@ -288,6 +288,7 @@ class Pipeline {
});
},
function getImports(web3Location, next) {
web3Location = web3Location.replace(/\\/g, '/'); // Import paths must always have forward slashes
code += "\nimport Web3 from '" + web3Location + "';\n";
code += "\n if (typeof web3 !== 'undefined') {";