Improve upgrade script
continuous-integration/drone/push Build is passing Details

This commit is contained in:
User user 2021-04-28 12:20:30 +02:00
parent 3cda4ee8c8
commit a0fef1ef76
3 changed files with 25 additions and 13 deletions

View File

@ -25,27 +25,39 @@ export default async function upgrade() {
}); });
if (res) { if (res) {
const cmd = [ const cmd_base = ["deno", "install", "-A", "--unstable", "-f"];
"deno",
"install", const cmd1 = [
"-A", ...cmd_base,
"--unstable",
"-f",
`https://deno.hibas123.de/raw/@denreg-cli@${meta.version}/denreg.ts`, `https://deno.hibas123.de/raw/@denreg-cli@${meta.version}/denreg.ts`,
]; ];
const cmd2 = [
...cmd_base,
`https://deno.hibas123.de/raw/@denreg-cli@${meta.version}/dpm.ts`,
];
await requestPermOrExit( await requestPermOrExit(
"run", "run",
"Run permission required to install new version. Or run it manually: " + "Run permission required to install new version. Or run it manually: " +
cmd.join(" ") cmd1.join(" ")
); );
const process = Deno.run({ const process1 = Deno.run({
cmd, cmd: cmd1,
}); });
const s = await process.status(); const s1 = await process1.status();
if (!s) { if (!s1) {
console.log(Colors.red("Upgrade failed!"));
}
const process2 = Deno.run({
cmd: cmd2,
});
const s2 = await process2.status();
if (!s2) {
console.log(Colors.red("Upgrade failed!")); console.log(Colors.red("Upgrade failed!"));
} }
} }

View File

@ -1,6 +1,6 @@
{ {
"name": "@denreg-cli", "name": "@denreg-cli",
"version": "0.3.2", "version": "0.3.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": [],

View File

@ -1 +1 @@
export const version = "0.3.2" export const version = "0.3.3"