Add upgrade command
This commit is contained in:
parent
438cee6bed
commit
c78f6822e1
@ -9,6 +9,7 @@ Since the cli requires access to:
|
|||||||
- reading and writing files
|
- reading and writing files
|
||||||
- access to environment variables
|
- access to environment variables
|
||||||
- network access
|
- network access
|
||||||
|
- run programs
|
||||||
|
|
||||||
The -A flag is the easiest way to install. You can however manually grant the required permissions.
|
The -A flag is the easiest way to install. You can however manually grant the required permissions.
|
||||||
|
|
||||||
@ -18,3 +19,4 @@ The -A flag is the easiest way to install. You can however manually grant the re
|
|||||||
| --allow-write | Write configuration file while using setup and init as well as during publish for temporary files |
|
| --allow-write | Write configuration file while using setup and init as well as during publish for temporary files |
|
||||||
| --allow-net | Access to network for uploading to the registry (can be exclusive to the registry) |
|
| --allow-net | Access to network for uploading to the registry (can be exclusive to the registry) |
|
||||||
| --allow-env | Required to get config file path relative to user home directory |
|
| --allow-env | Required to get config file path relative to user home directory |
|
||||||
|
| --allow-run | Required to run hook scripts |
|
||||||
|
@ -6,7 +6,7 @@ export default async function deprecate(options: any) {
|
|||||||
const meta = await getMeta();
|
const meta = await getMeta();
|
||||||
|
|
||||||
const res = await Cliffy.Confirm.prompt(
|
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) {
|
if (res) {
|
||||||
|
26
cli/commands/upgrade.ts
Normal file
26
cli/commands/upgrade.ts
Normal 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!"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -6,6 +6,7 @@ import initCMD from "./commands/init.ts";
|
|||||||
import bumpCMD from "./commands/bump.ts";
|
import bumpCMD from "./commands/bump.ts";
|
||||||
import publishCMD from "./commands/publish.ts";
|
import publishCMD from "./commands/publish.ts";
|
||||||
import deprecateCMD from "./commands/deprecate.ts";
|
import deprecateCMD from "./commands/deprecate.ts";
|
||||||
|
import upgradeCMD from "./commands/upgrade.ts";
|
||||||
|
|
||||||
const HOME_FOLDER = Deno.env.get("HOME") || Deno.env.get("USERPROFILE") || "";
|
const HOME_FOLDER = Deno.env.get("HOME") || Deno.env.get("USERPROFILE") || "";
|
||||||
|
|
||||||
@ -74,6 +75,12 @@ const flags = await new Cliffy.Command()
|
|||||||
.description("Deprecate package")
|
.description("Deprecate package")
|
||||||
.action(commandWrapper(deprecateCMD))
|
.action(commandWrapper(deprecateCMD))
|
||||||
)
|
)
|
||||||
|
.command(
|
||||||
|
"upgrade",
|
||||||
|
new Cliffy.Command()
|
||||||
|
.description("Upgrade to latest version of denreg cli")
|
||||||
|
.action(commandWrapper(upgradeCMD))
|
||||||
|
)
|
||||||
.command("completions", new Cliffy.CompletionsCommand())
|
.command("completions", new Cliffy.CompletionsCommand())
|
||||||
.parse(Deno.args);
|
.parse(Deno.args);
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@denreg-cli",
|
"name": "@denreg-cli",
|
||||||
"version": "0.2.0",
|
"version": "0.2.1",
|
||||||
"description": "CLI for the DenReg package registry",
|
"description": "CLI for the DenReg package registry",
|
||||||
"author": "Fabian Stamm <dev@fabianstamm.de>",
|
"author": "Fabian Stamm <dev@fabianstamm.de>",
|
||||||
"contributors": [],
|
"contributors": [],
|
||||||
|
Loading…
Reference in New Issue
Block a user