Skip to content

Commit

Permalink
fix: add all files after running fix-imports, not just decaffeinated …
Browse files Browse the repository at this point in the history
…files (#32)

jscodeshift discovers and converts and files importing a file that was run
through decaffeinate, so we don't have a nice list of files to `git add`. But we
already made sure at the start that the git worktree has no changes, so it
should be safe to just add all files.
  • Loading branch information
alangpierce authored Sep 25, 2016
1 parent 2361d52 commit 5022bc3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/convert.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,8 @@ Re-run with the "check" command for more details.`);
}
}

await runCommand(
'Running git add on all files again...',
p => `git add ${p}.js`,
{runInSeries: true});
console.log(`Running git add for all files with changes...`);
await exec(`git add -u`);

let postProcessCommitMsg =
`decaffeinate: Run post-processing cleanups on ${pluralize(baseFiles.length, 'file')}`;
Expand Down
2 changes: 2 additions & 0 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,8 @@ describe('fix-imports', () => {
let actualFile = expectedFile.substr(0, expectedFile.length - '.expected'.length);
await assertFilesEqual(actualFile, expectedFile);
}
let changedFiles = (await exec('git status --short --untracked-files=no'))[0];
assert.equal(changedFiles, '', 'Expected all file changes to be committed.');
});
}

Expand Down

0 comments on commit 5022bc3

Please sign in to comment.