diff --git a/lib/contracts/code_generator.js b/lib/contracts/code_generator.js index 4fa0ffd3e..3072cd81b 100644 --- a/lib/contracts/code_generator.js +++ b/lib/contracts/code_generator.js @@ -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(); diff --git a/lib/index.js b/lib/index.js index e08870ae0..3f04d4aca 100644 --- a/lib/index.js +++ b/lib/index.js @@ -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; diff --git a/lib/pipeline/pipeline.js b/lib/pipeline/pipeline.js index aab83f5f1..72616c3be 100644 --- a/lib/pipeline/pipeline.js +++ b/lib/pipeline/pipeline.js @@ -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') {";