mirror of
https://github.com/julia-actions/setup-julia.git
synced 2026-02-12 02:56:54 +08:00
Remove trailing v from versions before download
This commit is contained in:
6
lib/setup-julia.js
generated
6
lib/setup-julia.js
generated
@@ -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;
|
||||
});
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user