@@ -62,7 +62,7 @@ export default class FileUpload extends BaseClass {
6262 * @memberof FileUpload
6363 */
6464 async createNewProject ( ) : Promise < void > {
65- const { framework, projectName, buildCommand, outputDirectory, environmentName } = this . config ;
65+ const { framework, projectName, buildCommand, outputDirectory, environmentName, serverCommand } = this . config ;
6666 await this . apolloClient
6767 . mutate ( {
6868 mutation : importProjectMutation ,
@@ -77,6 +77,7 @@ export default class FileUpload extends BaseClass {
7777 name : environmentName || 'Default' ,
7878 environmentVariables : map ( this . envVariables , ( { key, value } ) => ( { key, value } ) ) ,
7979 buildCommand : buildCommand === undefined || buildCommand === null ? 'npm run build' : buildCommand ,
80+ serverCommand : serverCommand === undefined || serverCommand === null ? 'npm run start' : serverCommand ,
8081 } ,
8182 } ,
8283 skipGitData : true ,
@@ -113,6 +114,7 @@ export default class FileUpload extends BaseClass {
113114 'out-dir' : outputDirectory ,
114115 'variable-type' : variableType ,
115116 'env-variables' : envVariables ,
117+ 'server-command' : serverCommand ,
116118 alias,
117119 } = this . config . flags ;
118120 const { token, apiKey } = configHandler . get ( `tokens.${ alias } ` ) ?? { } ;
@@ -171,6 +173,15 @@ export default class FileUpload extends BaseClass {
171173 message : 'Output Directory' ,
172174 default : ( this . config . outputDirectories as Record < string , string > ) [ this . config ?. framework || 'OTHER' ] ,
173175 } ) ) ;
176+ if ( this . config . framework && this . config . supportedFrameworksForServerCommands . includes ( this . config . framework ) ) {
177+ this . config . serverCommand =
178+ serverCommand ||
179+ ( await cliux . inquire ( {
180+ type : 'input' ,
181+ name : 'serverCommand' ,
182+ message : 'Server Command' ,
183+ } ) ) ;
184+ }
174185 this . config . variableType = variableType as unknown as string ;
175186 this . config . envVariables = envVariables ;
176187 await this . handleEnvImportFlow ( ) ;
0 commit comments