Delete main.js
This commit is contained in:
parent
877e3e0632
commit
972ca0425b
46
main.js
46
main.js
@ -1,46 +0,0 @@
|
||||
const process = require("process");
|
||||
const core = require("@actions/core");
|
||||
|
||||
const { parseVersionRange, resolveVersion } = require("./src/version.js");
|
||||
const { install } = require("./src/install.js");
|
||||
|
||||
/**
|
||||
* @param {string} message
|
||||
* @returns {never}
|
||||
*/
|
||||
function exit(message) {
|
||||
core.setFailed(message);
|
||||
process.exit();
|
||||
}
|
||||
|
||||
async function main() {
|
||||
try {
|
||||
const range = parseVersionRange(core.getInput("deno-version"));
|
||||
if (range === null) {
|
||||
exit("The passed version range is not valid.");
|
||||
}
|
||||
|
||||
const version = await resolveVersion(range);
|
||||
if (version === null) {
|
||||
exit("Could not resolve a version for the given range.");
|
||||
}
|
||||
|
||||
core.info(
|
||||
`Going to install ${
|
||||
version.isCanary ? "canary" : "stable"
|
||||
} version ${version.version}.`,
|
||||
);
|
||||
|
||||
await install(version);
|
||||
|
||||
core.setOutput("deno-version", version.version);
|
||||
core.setOutput("is-canary", version.isCanary);
|
||||
|
||||
core.info("Installation complete.");
|
||||
} catch (err) {
|
||||
core.setFailed(err);
|
||||
process.exit();
|
||||
}
|
||||
}
|
||||
|
||||
main();
|
Loading…
x
Reference in New Issue
Block a user