From bcb3e16f9d87174ea31fe0bf8a4c6b4a534617d1 Mon Sep 17 00:00:00 2001 From: Fabian Stamm Date: Sun, 2 Aug 2020 23:40:12 +0200 Subject: [PATCH] Some improvements for the CLI --- cli/README.md | 2 +- cli/commands/publish.ts | 2 +- cli/denreg.ts | 9 ++++++++- cli/global.ts | 1 + cli/meta.json | 2 +- 5 files changed, 12 insertions(+), 4 deletions(-) diff --git a/cli/README.md b/cli/README.md index 792e5c4..7a0fea9 100644 --- a/cli/README.md +++ b/cli/README.md @@ -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 | diff --git a/cli/commands/publish.ts b/cli/commands/publish.ts index 17f625f..2cd5dab 100644 --- a/cli/commands/publish.ts +++ b/cli/commands/publish.ts @@ -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) { diff --git a/cli/denreg.ts b/cli/denreg.ts index 545c712..5b9955d 100644 --- a/cli/denreg.ts +++ b/cli/denreg.ts @@ -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); diff --git a/cli/global.ts b/cli/global.ts index 38138ed..467c29c 100644 --- a/cli/global.ts +++ b/cli/global.ts @@ -7,6 +7,7 @@ export interface IMeta { description?: string; author?: string; contributors?: string[]; + deprecated?: boolean; files: string[]; } diff --git a/cli/meta.json b/cli/meta.json index c43bfb5..4619dbb 100644 --- a/cli/meta.json +++ b/cli/meta.json @@ -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 ", "contributors": [],