Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- name: Setup Deno
uses: denoland/setup-deno@v1
with:
deno-version: ${{ matrix.deno == 'old' && '1.20.1' || (matrix.deno == 'stable' && '1.x' || matrix.deno) }}
deno-version: ${{ matrix.deno == 'old' && '1.28.3' || (matrix.deno == 'stable' && '1.x' || matrix.deno) }}

- run: deno --version

Expand Down
10 changes: 4 additions & 6 deletions src/subcommands/upgrade.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,8 @@ export default async function (rawArgs: Record<string, any>): Promise<void> {
console.log("You're using the latest version.");
Deno.exit();
} else {
// deno-lint-ignore no-deprecated-deno-api
const process = Deno.run({
cmd: [
Deno.execPath(),
const process = new Deno.Command(Deno.execPath(), {
args: [
"install",
"--allow-read",
"--allow-write",
Expand All @@ -74,8 +72,8 @@ export default async function (rawArgs: Record<string, any>): Promise<void> {
"-f",
`https://deno.land/x/deploy@${version ? version : latest}/deployctl.ts`,
],
});
await process.status();
}).spawn();
await process.status;
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/version.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export const VERSION = "1.6.0";

export const MINIMUM_DENO_VERSION = "1.20.0";
export const MINIMUM_DENO_VERSION = "1.28.3";
26 changes: 10 additions & 16 deletions tests/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export function deployctl(
env: true,
run: true,
},
): Deno.Process {
): Deno.ChildProcess {
const deno = [
Deno.execPath(),
"run",
Expand All @@ -34,13 +34,12 @@ export function deployctl(
? ["bash", "-c", [...deno, ...args].join(" ")]
: [...deno, ...args];

// deno-lint-ignore no-deprecated-deno-api
return Deno.run({
cmd,
return new Deno.Command(cmd[0], {
args: cmd.slice(1),
stdin: "null",
stdout: "piped",
stderr: "piped",
});
}).spawn();
}

export interface TestOptions {
Expand All @@ -51,26 +50,21 @@ export interface TestOptions {

export function test(
opts: TestOptions,
fn: (proc: Deno.Process) => void | Promise<void>,
fn: (proc: Deno.ChildProcess) => void | Promise<void>,
) {
const name = opts.name ?? ["deployctl", ...opts.args].join(" ");
Deno.test(name, async () => {
const proc = deployctl(opts.args, opts.permissions);
try {
await fn(proc);
} finally {
proc.close();
}
await fn(proc);
});
}

export async function output(
proc: Deno.Process,
): Promise<[string, string, Deno.ProcessStatus]> {
const [status, stdout, stderr] = await Promise.all([
proc.status(),
proc: Deno.ChildProcess,
): Promise<[string, string, Deno.CommandStatus]> {
const [status, { stdout, stderr }] = await Promise.all([
proc.status,
proc.output(),
proc.stderrOutput(),
]);
return [
new TextDecoder().decode(stdout),
Expand Down