Add upgrade command

This commit is contained in:
Fabian Stamm
2020-08-16 19:28:27 +02:00
parent 438cee6bed
commit c78f6822e1
5 changed files with 37 additions and 2 deletions

View File

@ -6,7 +6,7 @@ export default async function deprecate(options: any) {
const meta = await getMeta();
const res = await Cliffy.Confirm.prompt(
"Are you shure you want to deprecat this package?"
"Are you sure you want to deprecat this package?"
);
if (res) {

26
cli/commands/upgrade.ts Normal file
View File

@ -0,0 +1,26 @@
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!"));
}
}
}