From 0b3572f564145fb28bb2958a53b296a9c1b6885b Mon Sep 17 00:00:00 2001 From: Jonathan Rainville Date: Wed, 15 Aug 2018 11:42:28 -0400 Subject: [PATCH] set PWD directly instead of overriding chdir --- lib/index.js | 12 ++++-------- lib/process/processWrapper.js | 12 ++++-------- 2 files changed, 8 insertions(+), 16 deletions(-) diff --git a/lib/index.js b/lib/index.js index a2698080e..f98c17822 100644 --- a/lib/index.js +++ b/lib/index.js @@ -3,14 +3,10 @@ const constants = require('./constants'); 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); -}; +// Set PWD to CWD since Windows doesn't have a value for PWD +if (!process.env.PWD) { + process.env.PWD = process.cwd(); +} let version = require('../package.json').version; diff --git a/lib/process/processWrapper.js b/lib/process/processWrapper.js index f4eda6954..eee920e5a 100644 --- a/lib/process/processWrapper.js +++ b/lib/process/processWrapper.js @@ -1,14 +1,10 @@ const constants = require('../constants'); const Events = require('./eventsWrapper'); -// 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); -}; +// Set PWD to CWD since Windows doesn't have a value for PWD +if (!process.env.PWD) { + process.env.PWD = process.cwd(); +} class ProcessWrapper {