Skip to content

Commit

Permalink
Merge pull request #241 from yoavain/fix-issue-206-windows-compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
kopach committed Oct 9, 2022
2 parents 83d6277 + 92c84a9 commit 5d7b477
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 19 deletions.
56 changes: 39 additions & 17 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,12 @@
"chalk": "4.1.2",
"commander": "6.2.1",
"execa": "4.1.0",
"shelljs": "0.8.5",
"shortid": "2.2.16"
},
"devDependencies": {
"@types/node": "14.18.22",
"@types/shelljs": "0.8.11",
"@types/shortid": "0.0.29",
"adr": "1.4.1",
"lockfix": "2.0.1",
Expand Down
10 changes: 8 additions & 2 deletions src/lockfix.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import * as execa from 'execa';
import * as shell from 'shelljs';
import { writeFileSync } from 'fs';
import { EOL } from 'os';
import { underline } from 'chalk';
Expand Down Expand Up @@ -51,8 +52,13 @@ export default async function lockfix(doCommit: boolean): Promise<void> {
writeFileSync(patchName, commitDiff1 + EOL);
await execa('git', ['reset', '--hard', ...(doCommit ? ['HEAD^'] : ['HEAD'])]);

await execa('git', ['apply', patchName]);
await execa('rm', [patchName]);
await execa('git', [
'apply',
'--ignore-space-change',
'--ignore-whitespace',
patchName,
]);
shell.rm([patchName]);

log('✅ Done');
}
Expand Down

0 comments on commit 5d7b477

Please sign in to comment.