set PWD directly instead of overriding chdir
This commit is contained in:
parent
6da4f7527e
commit
0b3572f564
10
lib/index.js
10
lib/index.js
|
@ -3,14 +3,10 @@ const constants = require('./constants');
|
||||||
|
|
||||||
require('colors');
|
require('colors');
|
||||||
|
|
||||||
// Override process.chdir so that we have a partial-implementation PWD for Windows
|
// Set PWD to CWD since Windows doesn't have a value for PWD
|
||||||
const realChdir = process.chdir;
|
if (!process.env.PWD) {
|
||||||
process.chdir = (...args) => {
|
|
||||||
if (!process.env.PWD) {
|
|
||||||
process.env.PWD = process.cwd();
|
process.env.PWD = process.cwd();
|
||||||
}
|
}
|
||||||
realChdir(...args);
|
|
||||||
};
|
|
||||||
|
|
||||||
let version = require('../package.json').version;
|
let version = require('../package.json').version;
|
||||||
|
|
||||||
|
|
|
@ -1,14 +1,10 @@
|
||||||
const constants = require('../constants');
|
const constants = require('../constants');
|
||||||
const Events = require('./eventsWrapper');
|
const Events = require('./eventsWrapper');
|
||||||
|
|
||||||
// Override process.chdir so that we have a partial-implementation PWD for Windows
|
// Set PWD to CWD since Windows doesn't have a value for PWD
|
||||||
const realChdir = process.chdir;
|
if (!process.env.PWD) {
|
||||||
process.chdir = (...args) => {
|
|
||||||
if (!process.env.PWD) {
|
|
||||||
process.env.PWD = process.cwd();
|
process.env.PWD = process.cwd();
|
||||||
}
|
}
|
||||||
realChdir(...args);
|
|
||||||
};
|
|
||||||
|
|
||||||
class ProcessWrapper {
|
class ProcessWrapper {
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue