Skip to content

Commit dcebd86

Browse files
committed
Changelog file is now written to file
1 parent e8477b1 commit dcebd86

File tree

3 files changed

+22
-2
lines changed

3 files changed

+22
-2
lines changed

arduino-ide-extension/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"scripts": {
77
"prepare": "yarn download-cli && yarn download-fwuploader && yarn download-ls && yarn copy-serial-plotter && yarn clean && yarn download-examples && yarn build && yarn test",
88
"clean": "rimraf lib",
9+
"compose-changelog": "node ./scripts/compose-changelog.js",
910
"download-cli": "node ./scripts/download-cli.js",
1011
"download-fwuploader": "node ./scripts/download-fwuploader.js",
1112
"copy-serial-plotter": "npx ncp ../node_modules/arduino-serial-plotter-webapp ./build/arduino-serial-plotter-webapp",

arduino-ide-extension/scripts/compose-changelog.js

+19-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
// @ts-check
22

3+
34
(async () => {
45
const { Octokit } = require('@octokit/rest');
6+
const fs = require("fs");
7+
const path = require("path");
58

69
const octokit = new Octokit({
710
userAgent: 'Arduino IDE compose-changelog.js',
@@ -24,7 +27,22 @@
2427
return acc + `# ${item.name}\n\n${body}\n\n---\n\n`;
2528
}, '');
2629

27-
console.log(fullChangelog);
30+
const changelogFile = path.resolve(process.argv[process.argv.length - 1]);
31+
32+
await fs.writeFile(
33+
changelogFile,
34+
fullChangelog,
35+
{
36+
flag: "w+",
37+
},
38+
err => {
39+
if (err) {
40+
console.error(err);
41+
process.exit(1);
42+
}
43+
console.log("Changelog written to", changelogFile);
44+
}
45+
)
2846
})();
2947

3048

package.json

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

0 commit comments

Comments
 (0)