@@ -279,90 +279,94 @@ const logoutCommand = new Command()
279279 console . log ( "Successfully logged out" ) ;
280280 } ) ;
281281
282- await new Command ( )
283- . name ( "deno deploy" )
284- . description ( `Interact with Deno Deploy
282+ if ( Deno . env . has ( "DENO_DEPLOY_CLI_SANDBOX" ) ) {
283+ await sandboxCommand . parse ( Deno . args ) ;
284+ } else {
285+ await new Command ( )
286+ . name ( "deno deploy" )
287+ . description ( `Interact with Deno Deploy
285288
286289Calling this subcommand without any further subcommands will
287290deploy your local directory to the specified application.` )
288- . globalOption ( "--endpoint <endpoint:string>" , "the endpoint" , {
289- default : "https://console.deno.com" ,
290- hidden : true ,
291- } )
292- . globalOption ( "--debug" , "Enable debug output" , {
293- hidden : true ,
294- default : false ,
295- } )
296- . globalOption ( "--token <token:string>" , "Auth token to use" )
297- . globalOption ( "--config <config:string>" , "Path for the config file" )
298- . option ( "--org <name:string>" , "The name of the organization" )
299- . option ( "--app <name:string>" , "The name of the application" )
300- . option ( "--prod" , "Deploy directly to production" )
301- . option (
302- "--allow-node-modules" ,
303- "Allow node_modules directory to be included when uploading" ,
304- )
305- . option ( "--no-wait" , "Skip waiting for the build to complete" )
306- . arguments ( "[root-path:string]" )
307- . globalAction ( ( options ) => {
308- const endpoint = Deno . env . get ( "DENO_DEPLOY_ENDPOINT" ) ;
309- if ( endpoint ) {
310- options . endpoint = endpoint ;
311- }
312- const tokenEnv = options . token || Deno . env . get ( "DENO_DEPLOY_TOKEN" ) ;
313- if ( tokenEnv ) {
314- token_storage . set ( tokenEnv , true ) ;
315- }
316- } )
317- . action (
318- async (
319- options ,
320- rootPath = Deno . cwd ( ) ,
321- ) => {
322- const configContent = await readConfig ( rootPath , options . config ) ;
323- let { org, app } = getAppFromConfig ( configContent ) ;
324- org ??= options . org ;
325- app ??= options . app ;
326-
327- const orgAndApp = await withApp (
328- options . debug ,
329- options . endpoint as string ,
330- true ,
331- org ,
332- app ,
333- ) ;
291+ . globalOption ( "--endpoint <endpoint:string>" , "the endpoint" , {
292+ default : "https://console.deno.com" ,
293+ hidden : true ,
294+ } )
295+ . globalOption ( "--debug" , "Enable debug output" , {
296+ hidden : true ,
297+ default : false ,
298+ } )
299+ . globalOption ( "--token <token:string>" , "Auth token to use" )
300+ . globalOption ( "--config <config:string>" , "Path for the config file" )
301+ . option ( "--org <name:string>" , "The name of the organization" )
302+ . option ( "--app <name:string>" , "The name of the application" )
303+ . option ( "--prod" , "Deploy directly to production" )
304+ . option (
305+ "--allow-node-modules" ,
306+ "Allow node_modules directory to be included when uploading" ,
307+ )
308+ . option ( "--no-wait" , "Skip waiting for the build to complete" )
309+ . arguments ( "[root-path:string]" )
310+ . globalAction ( ( options ) => {
311+ const endpoint = Deno . env . get ( "DENO_DEPLOY_ENDPOINT" ) ;
312+ if ( endpoint ) {
313+ options . endpoint = endpoint ;
314+ }
315+ const tokenEnv = options . token || Deno . env . get ( "DENO_DEPLOY_TOKEN" ) ;
316+ if ( tokenEnv ) {
317+ token_storage . set ( tokenEnv , true ) ;
318+ }
319+ } )
320+ . action (
321+ async (
322+ options ,
323+ rootPath = Deno . cwd ( ) ,
324+ ) => {
325+ const configContent = await readConfig ( rootPath , options . config ) ;
326+ let { org, app } = getAppFromConfig ( configContent ) ;
327+ org ??= options . org ;
328+ app ??= options . app ;
334329
335- if ( orgAndApp . app === null ) {
336- await create (
337- options . debug ,
338- options . endpoint as string ,
339- rootPath ,
340- configContent ,
341- options . allowNodeModules ?? false ,
342- options . wait ?? true ,
343- orgAndApp . org ,
344- ) ;
345- } else {
346- await publish (
330+ const orgAndApp = await withApp (
347331 options . debug ,
348332 options . endpoint as string ,
349- rootPath ,
350- configContent ,
351- orgAndApp . org ,
352- orgAndApp . app ,
353- options . prod ?? false ,
354- options . allowNodeModules ?? false ,
355- options . wait ?? true ,
333+ true ,
334+ org ,
335+ app ,
356336 ) ;
357- }
358- } ,
359- )
360- . command ( "create" , createCommand )
361- . command ( "env" , envCommand )
362- . command ( "sandbox" , sandboxCommand )
363- . command ( "logs" , logsCommand )
364- . command ( "setup-aws" , setupAWSCommand )
365- . command ( "setup-gcp" , setupGCPCommand )
366- . command ( "tunnel-login" , tunnelLoginCommand )
367- . command ( "logout" , logoutCommand )
368- . parse ( Deno . args ) ;
337+
338+ if ( orgAndApp . app === null ) {
339+ await create (
340+ options . debug ,
341+ options . endpoint as string ,
342+ rootPath ,
343+ configContent ,
344+ options . allowNodeModules ?? false ,
345+ options . wait ?? true ,
346+ orgAndApp . org ,
347+ ) ;
348+ } else {
349+ await publish (
350+ options . debug ,
351+ options . endpoint as string ,
352+ rootPath ,
353+ configContent ,
354+ orgAndApp . org ,
355+ orgAndApp . app ,
356+ options . prod ?? false ,
357+ options . allowNodeModules ?? false ,
358+ options . wait ?? true ,
359+ ) ;
360+ }
361+ } ,
362+ )
363+ . command ( "create" , createCommand )
364+ . command ( "env" , envCommand )
365+ . command ( "sandbox" , sandboxCommand )
366+ . command ( "logs" , logsCommand )
367+ . command ( "setup-aws" , setupAWSCommand )
368+ . command ( "setup-gcp" , setupGCPCommand )
369+ . command ( "tunnel-login" , tunnelLoginCommand )
370+ . command ( "logout" , logoutCommand )
371+ . parse ( Deno . args ) ;
372+ }
0 commit comments