Skip to content

Commit 346c8aa

Browse files
author
Akos Kitta
committed
feat: handle v prefix in CLI GH release name
Ref: arduino/arduino-cli#2374 Signed-off-by: Akos Kitta <[email protected]>
1 parent 0e3b632 commit 346c8aa

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

Diff for: arduino-ide-extension/scripts/generate-protocol.js

+7-7
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
const { mkdirSync, promises: fs } = require('node:fs');
77
const { exec } = require('./utils');
88
const glob = require('glob');
9+
const { SemVer, gte, valid: validSemVer } = require('semver');
910
const protoc = path.dirname(require('protoc/protoc'));
1011

1112
const repository = await fs.mkdtemp(path.join(os.tmpdir(), 'arduino-cli-'));
@@ -94,13 +95,12 @@
9495
}
9596
*/
9697
const versionObject = JSON.parse(versionJson);
97-
const version = versionObject.VersionString;
98-
if (
99-
version &&
100-
!version.startsWith('nightly-') &&
101-
version !== '0.0.0-git' &&
102-
version !== 'git-snapshot'
103-
) {
98+
let version = versionObject.VersionString;
99+
if (validSemVer(version)) {
100+
// https://github.com/arduino/arduino-cli/pull/2374
101+
if (gte(new SemVer(version, { loose: true }), new SemVer('0.35.0-rc.1'))) {
102+
version = `v${version}`;
103+
}
104104
console.log(`>>> Checking out tagged version: '${version}'...`);
105105
exec('git', ['-C', repository, 'fetch', '--all', '--tags'], {
106106
logStdout: true,

0 commit comments

Comments
 (0)