Compare commits
3 Commits
ac73b62df2
...
2ee628544e
Author | SHA1 | Date | |
---|---|---|---|
|
2ee628544e | ||
|
c78f6822e1 | ||
|
438cee6bed |
@ -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,14 @@ 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";
|
||||||
|
|
||||||
|
let version = "unknown";
|
||||||
|
|
||||||
|
try {
|
||||||
|
const v = await import("./version.ts");
|
||||||
|
version = v.version;
|
||||||
|
} catch (err) {}
|
||||||
|
|
||||||
const HOME_FOLDER = Deno.env.get("HOME") || Deno.env.get("USERPROFILE") || "";
|
const HOME_FOLDER = Deno.env.get("HOME") || Deno.env.get("USERPROFILE") || "";
|
||||||
|
|
||||||
@ -25,7 +33,7 @@ const commandWrapper = (cmd: CommandHandler) => {
|
|||||||
};
|
};
|
||||||
const flags = await new Cliffy.Command()
|
const flags = await new Cliffy.Command()
|
||||||
.name("denreg")
|
.name("denreg")
|
||||||
.version("1.1.9")
|
.version(version)
|
||||||
.description("CLI for the Open Source DenReg package registry")
|
.description("CLI for the Open Source DenReg package registry")
|
||||||
.option("-i, --interactive [interactive:boolean]", "Interactive mode", {
|
.option("-i, --interactive [interactive:boolean]", "Interactive mode", {
|
||||||
default: true,
|
default: true,
|
||||||
@ -74,6 +82,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,7 +1,7 @@
|
|||||||
export * as Compress from "https://deno.hibas123.de/raw/@denreg-tar/mod.ts";
|
export * as Compress from "https://deno.hibas123.de/raw/@denreg-tar/mod.ts";
|
||||||
export * as Ini from "https://deno.land/x/ini/mod.ts";
|
export * as Ini from "https://deno.land/x/ini/mod.ts";
|
||||||
export * as Cliffy from "https://deno.land/x/cliffy/mod.ts";
|
export * as Cliffy from "https://deno.land/x/cliffy/mod.ts";
|
||||||
export * as Base64 from "https://deno.land/std@0.63.0/encoding/base64.ts";
|
export * as Base64 from "https://deno.land/std@0.65.0/encoding/base64.ts";
|
||||||
export * as FS from "https://deno.land/std@0.63.0/fs/mod.ts";
|
export * as FS from "https://deno.land/std@0.65.0/fs/mod.ts";
|
||||||
export * as Colors from "https://deno.land/std@0.63.0/fmt/colors.ts";
|
export * as Colors from "https://deno.land/std@0.65.0/fmt/colors.ts";
|
||||||
export * as Path from "https://deno.land/std@0.63.0/path/mod.ts";
|
export * as Path from "https://deno.land/std@0.65.0/path/mod.ts";
|
||||||
|
@ -1,8 +1,11 @@
|
|||||||
{
|
{
|
||||||
"name": "@denreg-cli",
|
"name": "@denreg-cli",
|
||||||
"version": "0.2.0",
|
"version": "0.2.3",
|
||||||
"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": [],
|
||||||
"files": ["**/*.ts", "**/*.js", "README.md"]
|
"files": ["**/*.ts", "**/*.js", "README.md"],
|
||||||
|
"hooks": {
|
||||||
|
"prepublish": "pre.ts"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
8
cli/pre.ts
Normal file
8
cli/pre.ts
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
import { FS } from "./deps.ts";
|
||||||
|
|
||||||
|
const meta = (await FS.readJson("./meta.json")) as any;
|
||||||
|
|
||||||
|
await Deno.writeTextFile(
|
||||||
|
"version.ts",
|
||||||
|
`export const version = "${meta.version}"`
|
||||||
|
);
|
1
cli/version.ts
Normal file
1
cli/version.ts
Normal file
@ -0,0 +1 @@
|
|||||||
|
export const version = "0.2.3"
|
Loading…
Reference in New Issue
Block a user