Skip to content

Commit

Permalink
fix(cli): upgrade holds
Browse files Browse the repository at this point in the history
  • Loading branch information
Qu4k committed May 22, 2020
1 parent 15599ca commit 41f46bd
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 12 deletions.
14 changes: 2 additions & 12 deletions denon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
printHelp,
initializeConfig,
grantPermissions,
upgrade,
} from "./src/cli.ts";
import { readConfig, DenonConfig } from "./src/config.ts";
import { parseArgs } from "./src/args.ts";
Expand Down Expand Up @@ -113,18 +114,7 @@ if (import.meta.main) {

// update denon to latest release
if (args.upgrade) {
log.info(
"Running \`deno install -Af --unstable https://deno.land/x/denon/denon.ts\`",
);
Deno.run({
cmd: [
"deno",
"install",
"-Af",
"--unstable",
"https://deno.land/x/denon/denon.ts",
],
});
await upgrade();
Deno.exit(0);
}

Expand Down
19 changes: 19 additions & 0 deletions src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,25 @@ export async function initializeConfig() {
}
}

/**
* Grab a fresh copy of denon
*/
export async function upgrade() {
log.info(
"Running \`deno install -Af --unstable https://deno.land/x/denon/denon.ts\`",
);
await Deno.run({
cmd: [
"deno",
"install",
"-Af",
"--unstable",
"https://deno.land/x/denon/denon.ts",
],
}).status();
Deno.exit(0);
}

/**
* List all available scripts declared in the config file.
* // TODO: make it interactive
Expand Down

0 comments on commit 41f46bd

Please sign in to comment.