Switched to the '0.14.0' CLI.

Signed-off-by: Akos Kitta <kittaakos@typefox.io>
This commit is contained in:
Akos Kitta
2020-12-07 10:49:49 +01:00
committed by Akos Kitta
parent c024a8d3d1
commit 4d5a046aa8
3 changed files with 16 additions and 4 deletions

View File

@@ -66,12 +66,12 @@
const { platform } = process;
const build = path.join(__dirname, '..', 'build');
const cli = path.join(build, `arduino-cli${platform === 'win32' ? '.exe' : ''}`);
const rawVersion = shell.exec(`${cli} version`).trim();
if (!rawVersion) {
const jsonVersion = shell.exec(`${cli} version --format json`).trim();
if (!jsonVersion) {
shell.echo(`Could not retrieve the CLI version from ${cli}.`);
shell.exit(1);
}
const version = rawVersion.substring(rawVersion.lastIndexOf('Commit:') + 'Commit:'.length).trim();
const version = JSON.parse(jsonVersion).VersionString;
if (version) {
shell.echo(`>>> Checking out version: ${version}...`);
if (shell.exec(`git -C ${repository} checkout ${version} -b ${version}`).code !== 0) {