Skip to content

Commit 08981fe

Browse files
committed
feat(cli): add upgrade command
1 parent 0e8d0a7 commit 08981fe

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

src/cli/deps.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
export { Command } from "https://deno.land/x/[email protected]/command/command.ts";
2+
export { UpgradeCommand } from "https://deno.land/x/[email protected]/command/upgrade/upgrade_command.ts";
3+
export { DenoLandProvider } from "https://deno.land/x/[email protected]/command/upgrade/provider/deno_land.ts";
24
export {
35
ValidationError,
46
} from "https://deno.land/x/[email protected]/flags/_errors.ts";

src/cli/mod.ts

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
import { VERSION } from "../../version.ts";
2-
import { io, path } from "../runtime/mod.ts";
2+
import { $, io, path } from "../runtime/mod.ts";
33
import { bundleCommand } from "./bundle.ts";
44
import { compileCommand } from "./compile.ts";
5-
import { Command, ValidationError } from "./deps.ts";
5+
import {
6+
Command,
7+
DenoLandProvider,
8+
UpgradeCommand,
9+
ValidationError,
10+
} from "./deps.ts";
611

712
export function dzx() {
813
return new Command<void>()
@@ -82,7 +87,14 @@ export function dzx() {
8287
},
8388
)
8489
.command("bundle", bundleCommand())
85-
.command("compile", compileCommand());
90+
.command("compile", compileCommand())
91+
.command(
92+
"upgrade",
93+
new UpgradeCommand({
94+
args: ["--allow-all", "--unstable"],
95+
provider: new DenoLandProvider(),
96+
}),
97+
);
8698

8799
function spawnWorker(perms: Permissions): void {
88100
new Worker(

0 commit comments

Comments
 (0)