DenReg/cli/commands/upgrade.ts
2020-08-16 19:28:27 +02:00

27 lines
610 B
TypeScript

import { Cliffy, Colors } from "../deps.ts";
export default async function upgrade() {
const res = await Cliffy.Confirm.prompt({
message: "Are you sure you want to upgrade the denreg cli?",
default: true,
});
if (res) {
const process = Deno.run({
cmd: [
"deno",
"install",
"-A",
"--unstable",
"-f",
"https://deno.hibas123.de/raw/@denreg-cli/denreg.ts",
],
});
const s = await process.status();
if (!s) {
console.log(Colors.red("Upgrade failed!"));
}
}
}