Skip to content

Commit

Permalink
fix: remove .orig file if exists
Browse files Browse the repository at this point in the history
  • Loading branch information
anonrig committed Nov 22, 2022
1 parent 6065c9d commit 392308b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ async function apply_patch(base_path, patch_path, output_path) {
}

await execSync(`patch -i ${patch_path} ${output_path} -R --no-backup-if-mismatch`);

const original_file = output_path + '.orig'
// Delete `output.md.orig` file, if exists
if (fs.existsSync(original_file)) {
fs.rmSync(original_file, { force: true })
}
}

module.exports = { apply_patch }

0 comments on commit 392308b

Please sign in to comment.