Skip to content
Open
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 auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ export const tokenStorage = {
} catch {
if (!cannotInteractWithKeychain) {
cannotInteractWithKeychain = true;
console.log(KEYCHAIN_WARNING);
console.error(KEYCHAIN_WARNING);
}
}
},
Expand Down
10 changes: 5 additions & 5 deletions deploy/create/mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -297,8 +297,8 @@ export const createCommand = new Command<GlobalContext>()
const region = required(options.region, "region");

if (!options.json) {
console.log("Using the following build configuration:");
console.log(renderBuildConfig(buildConfig satisfies BuildConfig));
console.error("Using the following build configuration:");
console.error(renderBuildConfig(buildConfig satisfies BuildConfig));
}

data = {
Expand Down Expand Up @@ -417,7 +417,7 @@ export async function createApp(

const appUrl = `${context.endpoint}/${data.org}/${data.app}`;
if (!context.json) {
console.log(`${green("✔")} Created app, view it at ${appUrl}`);
console.error(`${green("✔")} Created app, view it at ${appUrl}`);
}

// Local-source apps deploy via publish(), which emits its own JSON envelope
Expand Down Expand Up @@ -451,15 +451,15 @@ export async function createApp(
source: "github",
});
} else {
console.log(
console.error(
`You can view the revision here:\n ${context.endpoint}/${data.org}/${data.app}/builds/${revisionId}\n`,
);
}

if (wait) {
await waitForRevision(context, data.org, data.app, revisionId);
} else if (!context.json) {
console.log(
console.error(
"To see the deployment, go to the revision page and wait for the build to complete.",
);
}
Expand Down
6 changes: 4 additions & 2 deletions deploy/deployments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ const deploymentsListCommand = new Command<GlobalContext>()
}

if (res.items.length === 0) {
console.log("No deployments for this application.");
console.error("No deployments for this application.");
return;
}

Expand All @@ -93,7 +93,9 @@ const deploymentsListCommand = new Command<GlobalContext>()
);

if (res.nextCursor) {
console.log(`\nMore results available; pass --cursor ${res.nextCursor}`);
console.error(
`\nMore results available; pass --cursor ${res.nextCursor}`,
);
}
}));

Expand Down
4 changes: 2 additions & 2 deletions deploy/mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ const logoutCommand = new Command()
.description("Revoke the Deno Deploy token if one is present")
.action(() => {
tokenStorage.remove();
console.log(`${green("✔")} Successfully logged out`);
console.error(`${green("✔")} Successfully logged out`);
});

interface WhoamiOrg {
Expand Down Expand Up @@ -296,7 +296,7 @@ const whoamiCommand = new Command<GlobalContext>()
? `@${me.user.githubLogin}`
: me.user.email ?? me.user.name ?? me.user.id)
: `org-scoped token (${me.tokenType})`;
console.log(
console.error(
`${
green("✔")
} Authenticated as ${who}. ${orgs.length} reachable organization${
Expand Down
2 changes: 1 addition & 1 deletion deploy/orgs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const orgsListCommand = new Command<GlobalContext>()
}

if (orgs.length === 0) {
console.log("No organizations accessible with this token.");
console.error("No organizations accessible with this token.");
return;
}

Expand Down
6 changes: 5 additions & 1 deletion tests/create.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ if (!Deno.env.get("DENO_DEPLOY_TOKEN")) {
const deploy = async (...args: string[]) => {
const escaped = args.map((a) => $.escapeArg(a)).join(" ");
console.log(`deno deploy ${escaped}`);
return (await $.raw`deno deploy ${escaped}`.text()).trim();
// Status output (e.g. the build-config echo) goes to stderr per the CLI's
// stdout-discipline convention, so inspect the combined streams here.
const result = await $.raw`deno deploy ${escaped}`
.stderr("piped").stdout("piped");
return (result.stdout + result.stderr).trim();
};

const deployFail = async (...args: string[]) => {
Expand Down
Loading