Some improvements for the CLI
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Fabian Stamm 2020-08-02 23:40:12 +02:00
parent d56f0bcbea
commit bcb3e16f9d
5 changed files with 12 additions and 4 deletions

View File

@ -14,7 +14,7 @@ The -A flag is the easiest way to install. You can however manually grant the re
| permission | reason |
| ------------- | ------------------------------------------------------------------------------------------------- |
| --allow-read | Read configuration files (~/.denreg) as well the your project files on publish |
| --allow-read | Read configuration files (~/.denreg) as well as your project files on publish |
| --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-env | Required to get config file path relative to user home directory |

View File

@ -58,7 +58,7 @@ export default async function publish() {
.then((res) =>
res.status === 200
? res.json()
: Promise.reject(new Error("res.statusText"))
: Promise.reject(new Error(res.statusText))
)
.then((res) => {
if (!res.success) {

View File

@ -5,6 +5,7 @@ import setupCMD from "./commands/setup.ts";
import initCMD from "./commands/init.ts";
import bumpCMD from "./commands/bump.ts";
import publishCMD from "./commands/publish.ts";
import deprecateCMD from "./commands/deprecate.ts";
const HOME_FOLDER = Deno.env.get("HOME") || Deno.env.get("USERPROFILE") || "";
@ -25,7 +26,7 @@ const commandWrapper = (cmd: CommandHandler) => {
const flags = await new Cliffy.Command()
.name("denreg")
.version("0.0.1")
.version("0.1.6")
.description("CLI for the Open Source DenReg package registry")
.option("-i, --interactive [interactive:boolean]", "Interactive mode", {
default: true,
@ -65,6 +66,12 @@ const flags = await new Cliffy.Command()
.description("Change package version")
.action(commandWrapper(bumpCMD))
)
.command(
"deprecate",
new Cliffy.Command()
.description("Deprecate package")
.action(commandWrapper(deprecateCMD))
)
.command("completions", new Cliffy.CompletionsCommand())
.parse(Deno.args);

View File

@ -7,6 +7,7 @@ export interface IMeta {
description?: string;
author?: string;
contributors?: string[];
deprecated?: boolean;
files: string[];
}

View File

@ -1,6 +1,6 @@
{
"name": "@denreg-cli",
"version": "0.1.4",
"version": "0.1.8",
"description": "CLI for the DenReg package registry",
"author": "Fabian Stamm <dev@fabianstamm.de>",
"contributors": [],