Remove trailing v from versions before download

This commit is contained in:
Sascha Mann
2019-09-25 20:57:31 +02:00
parent 955535b050
commit 8007d2c472
2 changed files with 9 additions and 4 deletions

6
lib/setup-julia.js generated
View File

@@ -58,12 +58,14 @@ function getJuliaVersion(versionInput) {
// versionInput is a valid version, use it directly
return versionInput;
}
// use the highest available version that matches versionInput
// Use the highest available version that matches versionInput
const releases = yield getJuliaReleases();
const version = semver.maxSatisfying(releases, versionInput);
let version = semver.maxSatisfying(releases, versionInput);
if (version == null) {
throw `Could not find a Julia version that matches ${versionInput}`;
}
// GitHub tags start with v, remove it
version = version.replace(/^v/, '');
return version;
});
}

View File

@@ -47,13 +47,16 @@ async function getJuliaVersion(versionInput: string): Promise<string> {
return versionInput
}
// use the highest available version that matches versionInput
// Use the highest available version that matches versionInput
const releases = await getJuliaReleases()
const version = semver.maxSatisfying(releases, versionInput)
let version = semver.maxSatisfying(releases, versionInput)
if (version == null) {
throw `Could not find a Julia version that matches ${versionInput}`
}
// GitHub tags start with v, remove it
version = version.replace(/^v/, '')
return version
}