From e85d8b1ae53576e84a7fd09eb4bd9d39fc86fa01 Mon Sep 17 00:00:00 2001 From: Jonathan Rainville Date: Mon, 7 May 2018 16:33:30 -0400 Subject: [PATCH] fix file writing, now working --- lib/core/engine.js | 3 --- lib/pipeline/pipeline.js | 11 +++++++++++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/lib/core/engine.js b/lib/core/engine.js index 6aa0fc5df..40a2f7be7 100644 --- a/lib/core/engine.js +++ b/lib/core/engine.js @@ -140,9 +140,7 @@ class Engine { async.waterfall([ function getWeb3Version(next) { - console.log('Waiting for web3 version'); self.events.request("version:get:web3", function(web3Version) { - console.log('Web3 version', web3Version); next(null, web3Version); }); }, @@ -221,7 +219,6 @@ class Engine { communicationConfig: self.config.communicationConfig, events: self.events }); - console.log('LISTEN TO COMMANDS'); codeGenerator.listenToCommands(); codeGenerator.buildEmbarkJS(function() { self.events.emit('code-generator-ready'); diff --git a/lib/pipeline/pipeline.js b/lib/pipeline/pipeline.js index e697ee60d..567489459 100644 --- a/lib/pipeline/pipeline.js +++ b/lib/pipeline/pipeline.js @@ -3,6 +3,7 @@ const async = require('async'); const utils = require('../utils/utils.js'); const webpack = require("webpack"); const constants = require('../constants'); +const File = require('../core/file'); require("babel-preset-react"); require("babel-preset-es2015"); @@ -11,6 +12,15 @@ require("babel-preset-es2017"); let pipeline; +// 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); +}; + class Pipeline { constructor(options) { @@ -73,6 +83,7 @@ class Pipeline { // limit:1 due to issues when downloading required files such as web3.js async.mapLimit(files, 1, function(file, fileCb) { + file = new File(file); // Re-instantiate a File as through the process, we lose its prototype self.log("reading " + file.filename); if (file.filename.indexOf('.js') >= 0) {