fmt
This commit is contained in:
parent
4ad93eed32
commit
63b821882f
8
main.js
8
main.js
@ -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);
|
||||||
|
@ -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();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user