set PWD directly instead of overriding chdir

This commit is contained in:
Jonathan Rainville 2018-08-15 11:42:28 -04:00
parent 6da4f7527e
commit 0b3572f564
2 changed files with 8 additions and 16 deletions

View File

@ -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) => {
// Set PWD to CWD since Windows doesn't have a value for PWD
if (!process.env.PWD) {
process.env.PWD = process.cwd();
}
realChdir(...args);
};
let version = require('../package.json').version;

View File

@ -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) => {
// Set PWD to CWD since Windows doesn't have a value for PWD
if (!process.env.PWD) {
process.env.PWD = process.cwd();
}
realChdir(...args);
};
class ProcessWrapper {