Changelog file is now written to file

This commit is contained in:
Silvano Cerza 2022-01-26 11:41:14 +01:00 committed by Silvano Cerza
parent e8477b14f3
commit dcebd863cc
3 changed files with 22 additions and 2 deletions

View File

@ -6,6 +6,7 @@
"scripts": {
"prepare": "yarn download-cli && yarn download-fwuploader && yarn download-ls && yarn copy-serial-plotter && yarn clean && yarn download-examples && yarn build && yarn test",
"clean": "rimraf lib",
"compose-changelog": "node ./scripts/compose-changelog.js",
"download-cli": "node ./scripts/download-cli.js",
"download-fwuploader": "node ./scripts/download-fwuploader.js",
"copy-serial-plotter": "npx ncp ../node_modules/arduino-serial-plotter-webapp ./build/arduino-serial-plotter-webapp",

View File

@ -1,7 +1,10 @@
// @ts-check
(async () => {
const { Octokit } = require('@octokit/rest');
const fs = require("fs");
const path = require("path");
const octokit = new Octokit({
userAgent: 'Arduino IDE compose-changelog.js',
@ -24,7 +27,22 @@
return acc + `# ${item.name}\n\n${body}\n\n---\n\n`;
}, '');
console.log(fullChangelog);
const changelogFile = path.resolve(process.argv[process.argv.length - 1]);
await fs.writeFile(
changelogFile,
fullChangelog,
{
flag: "w+",
},
err => {
if (err) {
console.error(err);
process.exit(1);
}
console.log("Changelog written to", changelogFile);
}
)
})();

View File

@ -46,7 +46,8 @@
"i18n:generate": "theia nls-extract -e vscode -f \"+(arduino-ide-extension|browser-app|electron|electron-app|plugins)/**/*.ts?(x)\" -o ./i18n/en.json",
"i18n:check": "yarn i18n:generate && git add -N ./i18n && git diff --exit-code ./i18n",
"i18n:push": "node ./scripts/i18n/transifex-push.js ./i18n/en.json",
"i18n:pull": "node ./scripts/i18n/transifex-pull.js ./i18n/"
"i18n:pull": "node ./scripts/i18n/transifex-pull.js ./i18n/",
"compose-changelog": "yarn --cwd ./arduino-ide-extension compose-changelog"
},
"lint-staged": {
"./arduino-ide-extension/**/*.{ts,tsx}": [