Skip to content

Fix compose-changelog.js overwriting itself when called with no arguments #783

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 27, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fix compose-changelog.js overwriting itself when called with no argum…
…ents
  • Loading branch information
silvanocerza committed Jan 27, 2022
commit 253c8a74dcd2717572c39e2a88042c080d6fd9a4
7 changes: 6 additions & 1 deletion arduino-ide-extension/scripts/compose-changelog.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,12 @@
return acc + `# ${item.name}\n\n${body}\n\n---\n\n`;
}, '');

const changelogFile = path.resolve(process.argv[process.argv.length - 1]);
const args = process.argv.slice(2)
if (args.length == 0) {
console.error("Missing argument to destination file")
process.exit(1)
}
const changelogFile = path.resolve(args[0]);

await fs.writeFile(
changelogFile,
Expand Down