mirror of
https://github.com/arduino/arduino-ide.git
synced 2025-09-11 05:58:33 +00:00
Check for IDE update at startup (#797)
* Remove check for updates on startup setting * Remove useless exported function * Update template-package.json used to package IDE * Add function to get channel file during packaging step * Add updates check * move ide updater on backend * configure updater options * add auto update preferences * TMP check updates on start and download * index on check-update-startup:fcb8f6e
TMP check updates on start and download * set version to skip on local storage * add IDE setting to toggle update check on start-up * comment out check for updates on startup and auto update settings * Update Theia to 1.22.1 * updated CI * download changelog and show it in IDE updater dialog * remove useless file * remove useless code * add i18n to updater dialog * fix i18n * refactor UpdateInfo typing * add macos zip to artifacts * Simply use `--ignore-engines` * Use correct --ignore-engines * Fix semver#valid call * Use C++17 * updated documentation * add update channel preference * update updater url * updated documentation * Fix the C++ version * Build flag for cpp * add disclaimer with correct node version * Update `electron-builder` * Fix `Electron.Menu` issue * Skip electron rebuild * Rebuild native dependencies beforehand * Use resolutions section * Update template-package.json as well * move ide-updater to electron application * refactor ide-updater service * update yarn.lock * update i18n * Revert "Add gRPC user agent (#834)" This reverts commit5ab3a747a6
. * fix ide download url * update latest file in CI * fix i18n check Co-authored-by: Silvano Cerza <silvanocerza@gmail.com> Co-authored-by: Francesco Stasi <f.stasi@me.com> Co-authored-by: Mark Sujew <msujew@yahoo.de>
This commit is contained in:

committed by
GitHub

parent
9ecff86bbe
commit
f660058c75
@@ -1,36 +1,42 @@
|
||||
// @ts-check
|
||||
|
||||
|
||||
(async () => {
|
||||
const { Octokit } = require('@octokit/rest');
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
const octokit = new Octokit({
|
||||
userAgent: 'Arduino IDE compose-changelog.js',
|
||||
});
|
||||
|
||||
const response = await octokit.rest.repos.listReleases({
|
||||
owner: 'arduino',
|
||||
repo: 'arduino-ide',
|
||||
}).catch(err => {
|
||||
console.error(err);
|
||||
process.exit(1);
|
||||
})
|
||||
const response = await octokit.rest.repos
|
||||
.listReleases({
|
||||
owner: 'arduino',
|
||||
repo: 'arduino-ide',
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error(err);
|
||||
process.exit(1);
|
||||
});
|
||||
|
||||
const releases = response.data;
|
||||
|
||||
let fullChangelog = releases.reduce((acc, item) => {
|
||||
let fullChangelog = releases.reduce((acc, item, index) => {
|
||||
// Process each line separately
|
||||
const body = item.body.split('\n').map(processLine).join('\n')
|
||||
const body = item.body.split('\n').map(processLine).join('\n');
|
||||
// item.name is the name of the release changelog
|
||||
return acc + `# ${item.name}\n\n${body}\n\n---\n\n`;
|
||||
return (
|
||||
acc +
|
||||
`## ${item.name}\n\n${body}${
|
||||
index !== releases.length - 1 ? '\n\n---\n\n' : '\n'
|
||||
}`
|
||||
);
|
||||
}, '');
|
||||
|
||||
const args = process.argv.slice(2)
|
||||
const args = process.argv.slice(2);
|
||||
if (args.length == 0) {
|
||||
console.error("Missing argument to destination file")
|
||||
process.exit(1)
|
||||
console.error('Missing argument to destination file');
|
||||
process.exit(1);
|
||||
}
|
||||
const changelogFile = path.resolve(args[0]);
|
||||
|
||||
@@ -38,19 +44,18 @@
|
||||
changelogFile,
|
||||
fullChangelog,
|
||||
{
|
||||
flag: "w+",
|
||||
flag: 'w+',
|
||||
},
|
||||
err => {
|
||||
(err) => {
|
||||
if (err) {
|
||||
console.error(err);
|
||||
process.exit(1);
|
||||
}
|
||||
console.log("Changelog written to", changelogFile);
|
||||
console.log('Changelog written to', changelogFile);
|
||||
}
|
||||
)
|
||||
);
|
||||
})();
|
||||
|
||||
|
||||
// processLine applies different substitutions to line string.
|
||||
// We're assuming that there are no more than one substitution
|
||||
// per line to be applied.
|
||||
@@ -61,7 +66,8 @@ const processLine = (line) => {
|
||||
// * [#123](https://github.com/arduino/arduino-ide/pull/123/)
|
||||
// * [#123](https://github.com/arduino/arduino-ide/issues/123/)
|
||||
// If it does return the line as is.
|
||||
let r = /(\(|\[)#\d+(\)|\])(\(|\[)https:\/\/github\.com\/arduino\/arduino-ide\/(pull|issues)\/(\d+)\/?(\)|\])/gm;
|
||||
let r =
|
||||
/(\(|\[)#\d+(\)|\])(\(|\[)https:\/\/github\.com\/arduino\/arduino-ide\/(pull|issues)\/(\d+)\/?(\)|\])/gm;
|
||||
if (r.test(line)) {
|
||||
return line;
|
||||
}
|
||||
@@ -70,9 +76,12 @@ const processLine = (line) => {
|
||||
// * #123
|
||||
// If it does it's changed to:
|
||||
// * [#123](https://github.com/arduino/arduino-ide/pull/123)
|
||||
r = /#(\d+)/gm;
|
||||
r = /(?<![\w\d\/_]{1})#((\d)+)(?![\w\d\/_]{1})/gm;
|
||||
if (r.test(line)) {
|
||||
return line.replace(r, `[#$1](https://github.com/arduino/arduino-ide/pull/$1)`)
|
||||
return line.replace(
|
||||
r,
|
||||
`[#$1](https://github.com/arduino/arduino-ide/pull/$1)`
|
||||
);
|
||||
}
|
||||
|
||||
// Check if a link with one of the following format exists:
|
||||
@@ -85,7 +94,8 @@ const processLine = (line) => {
|
||||
// * [#123](https://github.com/arduino/arduino-ide/issues/123)
|
||||
// * [#123](https://github.com/arduino/arduino-ide/pull/123/)
|
||||
// * [#123](https://github.com/arduino/arduino-ide/issues/123/)
|
||||
r = /(https:\/\/github\.com\/arduino\/arduino-ide\/(pull|issues)\/(\d+)\/?)/gm;
|
||||
r =
|
||||
/(https:\/\/github\.com\/arduino\/arduino-ide\/(pull|issues)\/(\d+)\/?)/gm;
|
||||
if (r.test(line)) {
|
||||
return line.replace(r, `[#$3]($1)`);
|
||||
}
|
||||
@@ -95,11 +105,12 @@ const processLine = (line) => {
|
||||
// * https://github.com/arduino/arduino-ide/compare/2.0.0-rc2...2.0.0-rc3/
|
||||
// If it does it's changed to:
|
||||
// * [`2.0.0-rc2...2.0.0-rc3`](https://github.com/arduino/arduino-ide/compare/2.0.0-rc2...2.0.0-rc3)
|
||||
r = /(https:\/\/github\.com\/arduino\/arduino-ide\/compare\/([^\/]*))\/?\s?/gm;
|
||||
r =
|
||||
/(https:\/\/github\.com\/arduino\/arduino-ide\/compare\/([^\/]*))\/?\s?/gm;
|
||||
if (r.test(line)) {
|
||||
return line.replace(r, '[`$2`]($1)');;
|
||||
return line.replace(r, '[`$2`]($1)');
|
||||
}
|
||||
|
||||
// If nothing matches just return the line as is
|
||||
return line;
|
||||
}
|
||||
};
|
||||
|
Reference in New Issue
Block a user