Update to work with newer deno versions
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Fabian Stamm 2021-04-15 17:20:09 +02:00
parent 9dfb8d65d3
commit 22a447604b
6 changed files with 17 additions and 18 deletions

View File

@ -84,6 +84,7 @@ const flags = await new Cliffy.Command()
.action(commandWrapper(upgradeCMD))
)
.command("completions", new Cliffy.CompletionsCommand())
.command("help", new Cliffy.HelpCommand().global())
.parse(Deno.args);
await init(flags.options);
@ -95,5 +96,5 @@ if (command) {
console.log(Colors.bold(Colors.red("An error occured:")), err.message);
}
} else {
flags.cmd.help();
flags.cmd.showHelp();
}

View File

@ -1,7 +1,7 @@
export * as Compress from "https://deno.hibas123.de/raw/@denreg-tar/mod.ts";
export * as Ini from "https://deno.land/x/ini@v2.1.0/mod.ts";
export * as Cliffy from "https://deno.land/x/cliffy@v0.16.0/mod.ts";
export * as Base64 from "https://deno.land/std@0.65.0/encoding/base64.ts";
export * as FS from "https://deno.land/std@0.65.0/fs/mod.ts";
export * as Colors from "https://deno.land/std@0.65.0/fmt/colors.ts";
export * as Path from "https://deno.land/std@0.65.0/path/mod.ts";
export * as Cliffy from "https://deno.land/x/cliffy@v0.18.2/mod.ts";
export * as Base64 from "https://deno.land/std@0.91.0/encoding/base64.ts";
export * as FS from "https://deno.land/std@0.91.0/fs/mod.ts";
export * as Colors from "https://deno.land/std@0.91.0/fmt/colors.ts";
export * as Path from "https://deno.land/std@0.91.0/path/mod.ts";

View File

@ -42,16 +42,18 @@ export async function setConfig(name: string, value: string) {
});
}
const readJson = (name: string) => Deno.readTextFile(name).then(JSON.parse);
const writeJson = (name: string, value: any, spaces?: string) =>
Deno.writeTextFile(name, JSON.stringify(value, null, spaces));
export async function getMeta() {
log("Reading meta.json");
return (await FS.readJson("meta.json")) as IMeta;
return (await readJson("meta.json")) as IMeta;
}
export async function setMeta(meta: IMeta): Promise<void> {
log("Saving meta.json");
return FS.writeJson("meta.json", meta, {
spaces: " ",
});
return writeJson("meta.json", meta, " ");
}
let interactive = true;

View File

@ -1,14 +1,10 @@
{
"name": "@denreg-cli",
"version": "0.2.10",
"version": "0.2.11",
"description": "CLI for the DenReg package registry",
"author": "Fabian Stamm <dev@fabianstamm.de>",
"contributors": [],
"files": [
"**/*.ts",
"**/*.js",
"README.md"
],
"files": ["**/*.ts", "**/*.js", "README.md"],
"hooks": {
"prepublish": "pre.ts"
}

View File

@ -1,6 +1,6 @@
import { FS } from "./deps.ts";
const meta = (await FS.readJson("./meta.json")) as any;
const meta = (await Deno.readTextFile("./meta.json").then(JSON.parse)) as any;
await Deno.writeTextFile(
"version.ts",

View File

@ -1 +1 @@
export const version = "0.2.10"
export const version = "0.2.11"