diff --git a/dist/index.js b/dist/index.js index 60b37c7..4bdd994 100644 --- a/dist/index.js +++ b/dist/index.js @@ -29,7 +29,13 @@ async function apply_patch(base_path, patch_path, output_path) { throw new Error(`patch_path (${patch_path}) does not exist`) } - await execSync(`patch ${output_path} ${patch_path} -R`); + 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 } diff --git a/package.json b/package.json index 9104fc1..01d8f2d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "code-of-conduct", - "version": "1.0.1", + "version": "1.0.2", "description": "A tool for generating a code of conduct with patches", "main": "lib/index.js", "scripts": {