diff --git a/lib/util/getGitRootDir.js b/lib/util/getGitRootDir.js index 1003132f..8fdbceb2 100644 --- a/lib/util/getGitRootDir.js +++ b/lib/util/getGitRootDir.js @@ -1,7 +1,8 @@ const {execSync} = require('child_process'); const getGitRootDir = () => { - const dir = execSync('git rev-parse --show-toplevel 2>/dev/null') + const devNull = os.platform() === 'win32' ? 'nul' : '/dev/null' + const dir = execSync('git rev-parse --show-toplevel 2> ' + devNull) .toString() .trim(); diff --git a/lib/util/lerna.js b/lib/util/lerna.js index 6ef0b22b..26500102 100755 --- a/lib/util/lerna.js +++ b/lib/util/lerna.js @@ -27,11 +27,13 @@ const getAllPackages = (state) => { } }; -const getChangedFiles = () => - execSync('git diff --cached --name-only 2>/dev/null') +const getChangedFiles = () => { + const devNull = os.platform() === 'win32' ? 'nul' : '/dev/null' + execSync('git diff --cached --name-only 2> ' + devNull) .toString() .trim() .split('\n'); +} const getChangedPackages = () => { const unique = {};