Skip to content

Commit

Permalink
fix: Fix repo status detection
Browse files Browse the repository at this point in the history
Affected `--pull` option
  • Loading branch information
medikoo committed May 16, 2019
1 parent addff4d commit 9a97f37
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/setup-repository.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@ module.exports = async (path, repoUrl, options = {}) => {

if (tryPull) {
// Confirm directory is clean
const { stdout: localStatus } = await runProgram("git", ["status", "--porcelain"], {
const { stdoutBuffer } = await runProgram("git", ["status", "--porcelain"], {
cwd: path
});
const localStatus = String(stdoutBuffer);
if (localStatus) {
throw new NpmCrossLinkError(
`Cannot proceed with update, repository at ${ path } is not clean:\n${
Expand All @@ -37,7 +38,8 @@ module.exports = async (path, repoUrl, options = {}) => {
});
}

const { stdoutBuffer: localStatus } = await runProgram("git", ["status"], { cwd: path });
const { stdoutBuffer } = await runProgram("git", ["status"], { cwd: path });
const localStatus = String(stdoutBuffer);

if (
tryPull &&
Expand Down

0 comments on commit 9a97f37

Please sign in to comment.