This commit is contained in:
Yoshiya Hinosawa 2024-07-05 14:38:04 +09:00
parent 4ad93eed32
commit 63b821882f
No known key found for this signature in database
GPG Key ID: 9017DB4559488785
2 changed files with 8 additions and 8 deletions

View File

@ -23,7 +23,7 @@ async function main() {
const range = parseVersionRange( const range = parseVersionRange(
denoVersionFile denoVersionFile
? getDenoVersionFromFile(denoVersionFile) ? getDenoVersionFromFile(denoVersionFile)
: core.getInput("deno-version") : core.getInput("deno-version"),
); );
if (range === null) { if (range === null) {
@ -36,9 +36,9 @@ async function main() {
} }
core.info( core.info(
`Going to install ${version.isCanary ? "canary" : "stable"} version ${ `Going to install ${
version.version version.isCanary ? "canary" : "stable"
}.` } version ${version.version}.`,
); );
await install(version); await install(version);

View File

@ -51,7 +51,7 @@ function parseVersionRange(version) {
function getDenoVersionFromFile(versionFilePath) { function getDenoVersionFromFile(versionFilePath) {
if (!fs.existsSync(versionFilePath)) { if (!fs.existsSync(versionFilePath)) {
throw new Error( throw new Error(
`The specified node version file at: ${versionFilePath} does not exist` `The specified node version file at: ${versionFilePath} does not exist`,
); );
} }
@ -70,11 +70,11 @@ async function resolveVersion({ range, isCanary }) {
if (isCanary) { if (isCanary) {
if (range === "latest") { if (range === "latest") {
const res = await fetchWithRetries( const res = await fetchWithRetries(
"https://dl.deno.land/canary-latest.txt" "https://dl.deno.land/canary-latest.txt",
); );
if (res.status !== 200) { if (res.status !== 200) {
throw new Error( throw new Error(
"Failed to fetch canary version info from dl.deno.land. Please try again later." "Failed to fetch canary version info from dl.deno.land. Please try again later.",
); );
} }
const version = (await res.text()).trim(); const version = (await res.text()).trim();
@ -86,7 +86,7 @@ async function resolveVersion({ range, isCanary }) {
const res = await fetchWithRetries("https://deno.com/versions.json"); const res = await fetchWithRetries("https://deno.com/versions.json");
if (res.status !== 200) { if (res.status !== 200) {
throw new Error( throw new Error(
"Failed to fetch stable version info from deno.com/versions.json. Please try again later." "Failed to fetch stable version info from deno.com/versions.json. Please try again later.",
); );
} }
const versionJson = await res.json(); const versionJson = await res.json();