mirror of
https://github.com/arduino/arduino-ide.git
synced 2025-07-25 20:26:38 +00:00
Fix compose-changelog.js overwriting itself when called with no arguments
This commit is contained in:
parent
8a0454db51
commit
b3b22795f8
@ -27,7 +27,12 @@
|
|||||||
return acc + `# ${item.name}\n\n${body}\n\n---\n\n`;
|
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(
|
await fs.writeFile(
|
||||||
changelogFile,
|
changelogFile,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user