Skip to content

Commit

Permalink
fix: Windows support
Browse files Browse the repository at this point in the history
Fixes #12
  • Loading branch information
Marcin Kłopotek committed Feb 25, 2019
1 parent 19bd84a commit bcc3525
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion lib/util/getGitRootDir.js
Original file line number Diff line number Diff line change
@@ -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();

Expand Down
6 changes: 4 additions & 2 deletions lib/util/lerna.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {};
Expand Down

0 comments on commit bcc3525

Please sign in to comment.