Compare commits

..

No commits in common. "6bfcb3642d79fcf04cd8e2c859f5be36261abeae" and "dd1d8e0947edb396009d19b344e1f72125cde3c0" have entirely different histories.

5 changed files with 12 additions and 17 deletions

View File

@ -1,6 +1,5 @@
import { Colors, Path, FS, Compress, Base64 } from "../deps.ts"; import { Colors, Path, FS, Compress, Base64 } from "../deps.ts";
import { getMeta, IMeta, log, getConfig } from "../global.ts"; import { getMeta, IMeta, log, getConfig } from "../global.ts";
import { ServerError } from "../helper/server_error.ts";
async function runScript(script: string) { async function runScript(script: string) {
console.log(Colors.bold(Colors.blue("Running script:")), script); console.log(Colors.bold(Colors.blue("Running script:")), script);
@ -105,20 +104,17 @@ export default async function publish(options: { dry: boolean }) {
.then((res) => .then((res) =>
res.status === 200 res.status === 200
? res.json() ? res.json()
: Promise.reject(new ServerError(res.statusText)) : Promise.reject(new Error(res.statusText))
) )
.then((res) => { .then((res) => {
if (!res.success) { if (!res.success) {
throw new ServerError(res.message); throw new Error(res.message);
} else { } else {
console.log(Colors.green("Upload successfull")); console.log(Colors.green("Upload successfull"));
} }
}) })
.catch((err) => { .catch((err) => {
//import { ServerError } from "../helper/server_error.ts"; console.log(Colors.red("Error: " + err.message));
if (err instanceof ServerError)
console.log(Colors.red("Server Error: " + err.message));
else console.log(Colors.red("Error: " + err.message));
}); });
} else { } else {
console.log(Colors.yellow("Dry run. Skipping upload")); console.log(Colors.yellow("Dry run. Skipping upload"));

View File

@ -1,6 +1,6 @@
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@v2.1.0/mod.ts"; export * as Ini from "https://deno.land/x/ini/mod.ts";
export * as Cliffy from "https://deno.land/x/cliffy@v0.14.1/mod.ts"; export * as Cliffy from "https://deno.land/x/cliffy/mod.ts";
export * as Base64 from "https://deno.land/std@0.65.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.65.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.65.0/fmt/colors.ts"; export * as Colors from "https://deno.land/std@0.65.0/fmt/colors.ts";

View File

@ -1,5 +0,0 @@
export class ServerError extends Error {
constructor(message: string) {
super(message);
}
}

View File

@ -1,10 +1,14 @@
{ {
"name": "@denreg-cli", "name": "@denreg-cli",
"version": "0.2.5", "version": "0.2.4",
"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": { "hooks": {
"prepublish": "pre.ts" "prepublish": "pre.ts"
} }

View File

@ -1 +1 @@
export const version = "0.2.5" export const version = "0.2.4"