Skip to content

Commit

Permalink
feat: handle v prefix in CLI GH release name
Browse files Browse the repository at this point in the history
Ref: arduino/arduino-cli#2374
Signed-off-by: Akos Kitta <[email protected]>
  • Loading branch information
Akos Kitta authored and kittaakos committed Dec 13, 2023
1 parent 64ce35e commit 101ba65
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions arduino-ide-extension/scripts/generate-protocol.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
const { mkdirSync, promises: fs } = require('node:fs');
const { exec } = require('./utils');
const glob = require('glob');
const { SemVer, gte, valid: validSemVer } = require('semver');
const protoc = path.dirname(require('protoc/protoc'));

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

0 comments on commit 101ba65

Please sign in to comment.