Add deprecate command to CLI
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
c358486bd8
commit
d56f0bcbea
@ -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
20
cli/commands/deprecate.ts
Normal 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);
|
||||
}
|
Loading…
Reference in New Issue
Block a user