Skip to content

Commit ba009b2

Browse files
committed
support no config and passing org/app/token back
1 parent 10c3211 commit ba009b2

1 file changed

Lines changed: 14 additions & 3 deletions

File tree

main.ts

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import {
1414
envUpdateContextsCommand,
1515
envUpdateValueCommand,
1616
} from "./env.ts";
17-
import { createTrpcClient } from "./auth.ts";
17+
import { createTrpcClient, getAuth } from "./auth.ts";
1818
import token_storage from "./token_storage.ts";
1919
import {
2020
sandboxKillCommand,
@@ -142,6 +142,8 @@ const setupGCPCommand = new Command<GlobalOptions>()
142142

143143
const tunnelLoginCommand = new Command<GlobalOptions>()
144144
.arguments("[root-path:string]")
145+
.option("--really-no-config", "really no config")
146+
.option("--out <file:string>", "out file")
145147
.hidden()
146148
.action(async (options, rootPath = Deno.cwd()) => {
147149
const configContent = await readConfig(rootPath, options.config);
@@ -153,7 +155,16 @@ const tunnelLoginCommand = new Command<GlobalOptions>()
153155
org,
154156
app,
155157
);
156-
await writeConfig(configContent, gottenApp.org, gottenApp.app);
158+
if (options.reallyNoConfig !== true) {
159+
await writeConfig(configContent, gottenApp.org, gottenApp.app);
160+
}
161+
const token = await getAuth(options.debug, options.endpoint);
162+
if (options.out) {
163+
await Deno.writeTextFile(
164+
options.out,
165+
JSON.stringify({ org: gottenApp.org, app: gottenApp.app, token }),
166+
);
167+
}
157168
});
158169

159170
const envCommand = new Command<GlobalOptions>()
@@ -283,7 +294,7 @@ const logoutCommand = new Command()
283294
await new Command()
284295
.name("deno deploy")
285296
.description(`Interact with Deno Deploy
286-
297+
287298
Calling this subcommand without any further subcommands will
288299
deploy your local directory to the specified application.`)
289300
.globalOption("--endpoint <endpoint:string>", "the endpoint", {

0 commit comments

Comments
 (0)