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
10 changes: 10 additions & 0 deletions deploy/mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { Command, ValidationError } from "@cliffy/command";
import { green, red, yellow } from "@std/fmt/colors";
import { error, renderTemporalTimestamp } from "../util.ts";
import { createSwitchCommand, type GlobalContext } from "../main.ts";
import { VERSION } from "../version.ts";
import { actionHandler, getApp, getOrg } from "../config.ts";
import { publish } from "./publish.ts";
import { setupAws, setupGcp } from "./setup-cloud.ts";
Expand Down Expand Up @@ -181,6 +182,7 @@ const logoutCommand = new Command()

export const deployCommand = new Command()
.name("deno deploy")
.version(VERSION)
.description(`Interact with Deno Deploy

Calling this subcommand without any further subcommands will
Expand Down Expand Up @@ -223,6 +225,14 @@ deploy your local directory to the specified application.`)
if (tokenEnv) {
tokenStorage.set(tokenEnv, true);
}

if (options.debug) {
console.error(
yellow(
`Debug mode is enabled (deno ${Deno.version.deno}, @deno/deploy ${VERSION}, endpoint=${options.endpoint})`,
),
);
}
})
.action(
actionHandler(
Expand Down
12 changes: 11 additions & 1 deletion sandbox/mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
type VolumeId,
type VolumeSlug,
} from "@deno/sandbox";
import { green, magenta, red } from "@std/fmt/colors";
import { green, magenta, red, yellow } from "@std/fmt/colors";
import { pooledMap } from "@std/async";
import { expandGlob } from "@std/fs";
import { join } from "@std/path";
Expand All @@ -19,6 +19,7 @@ import {
} from "../util.ts";
import { createTrpcClient, getAuth, tokenStorage } from "../auth.ts";
import { createSwitchCommand, type GlobalContext } from "../main.ts";
import { VERSION } from "../version.ts";

import { volumesCommand } from "./volumes.ts";
import { snapshotsCommand } from "./snapshot.ts";
Expand Down Expand Up @@ -588,6 +589,7 @@ Example:

export const sandboxCommand = new Command<GlobalContext>()
.name("deno sandbox")
.version(VERSION)
.description("Interact with sandboxes")
.globalOption("--endpoint <endpoint:string>", "the endpoint", {
default: "https://console.deno.com",
Expand Down Expand Up @@ -615,6 +617,14 @@ export const sandboxCommand = new Command<GlobalContext>()
if (tokenEnv) {
tokenStorage.set(tokenEnv, true);
}

if (options.debug) {
console.error(
yellow(
`Debug mode is enabled (deno ${Deno.version.deno}, @deno/deploy ${VERSION}, endpoint=${options.endpoint})`,
),
);
}
})
.action(() => {
sandboxCommand.showHelp();
Expand Down
4 changes: 4 additions & 0 deletions version.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import denoJson from "./deno.json" with { type: "json" };

export const VERSION = (denoJson as { version?: string }).version ??
"0.0.0-dev";
Loading