@@ -7,6 +7,7 @@ import { startShell } from '../src/commands/shell.js';
77import { PROJECT_NAME , getLatestVersion } from '../src/commons.js' ;
88import { createApp } from '../src/commands/apps.js' ;
99import { deploy } from '../src/commands/deploy.js' ;
10+ import inquirer from 'inquirer' ;
1011
1112async function main ( ) {
1213 const version = await getLatestVersion ( PROJECT_NAME ) ;
@@ -70,9 +71,32 @@ async function main() {
7071 site
7172 . command ( 'deploy' )
7273 . description ( 'Deploy a local web project to Puter' )
73- . argument ( '< local_dir> ' , 'Local directory path' )
74- . argument ( '[< subdomain> ]' , 'Deployment subdomain (<subdomain>.puter.site)' )
74+ . argument ( '[ local_dir] ' , 'Local directory path' )
75+ . argument ( '[subdomain]' , 'Deployment subdomain (<subdomain>.puter.site)' )
7576 . action ( async ( local_dir , subdomain ) => {
77+ if ( ! local_dir ) {
78+ const answer = await inquirer . prompt ( [
79+ {
80+ type : 'input' ,
81+ name : 'local_dir' ,
82+ message : 'Local directory path:' ,
83+ default : '.'
84+ }
85+ ] ) ;
86+ local_dir = answer . local_dir ;
87+ }
88+
89+ if ( ! subdomain ) {
90+ const answer = await inquirer . prompt ( [
91+ {
92+ type : 'input' ,
93+ name : 'subdomain' ,
94+ message : 'Deployment subdomain (leave empty for random):' ,
95+ }
96+ ] ) ;
97+ subdomain = answer . subdomain ;
98+ }
99+
76100 await startShell ( `site:deploy ${ local_dir } ${ subdomain ? ` --subdomain=${ subdomain } ` : '' } ` )
77101 process . exit ( 0 ) ;
78102 } ) ;
0 commit comments