Add deprecate command to CLI
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Fabian Stamm 2020-08-02 23:37:59 +02:00
parent c358486bd8
commit d56f0bcbea
2 changed files with 22 additions and 1 deletions

View File

@ -1,6 +1,6 @@
import { Colors } from "../deps.ts";
import { getMeta, setMeta } from "../global.ts";
import { getMeta, setMeta, log } from "../global.ts";
export default async function bump(
options: any,
@ -26,6 +26,7 @@ export default async function bump(
default:
throw new Error("type must be either major, minor or patch");
}
log(major, minor, patch);
const newVersion = [major, minor, patch].join(".");
console.log(
"Bumping version from",

20
cli/commands/deprecate.ts Normal file
View File

@ -0,0 +1,20 @@
import { Colors, Cliffy } from "../deps.ts";
import { getMeta, setMeta, log } from "../global.ts";
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?"
);
if (res) {
meta.deprecated = true;
console.log(Colors.yellow("Package marked as deprecated!"));
} else {
console.log("Deprecation canceled");
}
await setMeta(meta);
}