mirror of
https://github.com/julia-actions/setup-julia.git
synced 2026-02-18 14:06: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
|
// versionInput is a valid version, use it directly
|
||||||
return versionInput;
|
return versionInput;
|
||||||
}
|
}
|
||||||
// use the highest available version that matches versionInput
|
// Use the highest available version that matches versionInput
|
||||||
const releases = yield getJuliaReleases();
|
const releases = yield getJuliaReleases();
|
||||||
const version = semver.maxSatisfying(releases, versionInput);
|
let version = semver.maxSatisfying(releases, versionInput);
|
||||||
if (version == null) {
|
if (version == null) {
|
||||||
throw `Could not find a Julia version that matches ${versionInput}`;
|
throw `Could not find a Julia version that matches ${versionInput}`;
|
||||||
}
|
}
|
||||||
|
// GitHub tags start with v, remove it
|
||||||
|
version = version.replace(/^v/, '');
|
||||||
return version;
|
return version;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -47,13 +47,16 @@ async function getJuliaVersion(versionInput: string): Promise<string> {
|
|||||||
return versionInput
|
return versionInput
|
||||||
}
|
}
|
||||||
|
|
||||||
// use the highest available version that matches versionInput
|
// Use the highest available version that matches versionInput
|
||||||
const releases = await getJuliaReleases()
|
const releases = await getJuliaReleases()
|
||||||
const version = semver.maxSatisfying(releases, versionInput)
|
let version = semver.maxSatisfying(releases, versionInput)
|
||||||
if (version == null) {
|
if (version == null) {
|
||||||
throw `Could not find a Julia version that matches ${versionInput}`
|
throw `Could not find a Julia version that matches ${versionInput}`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GitHub tags start with v, remove it
|
||||||
|
version = version.replace(/^v/, '')
|
||||||
|
|
||||||
return version
|
return version
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user