File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -57,16 +57,22 @@ export async function createProject(cwd: string) {
5757 const installCmd = resolveCommand ( pm , 'install' , [ ] ) ;
5858 const runCmd = resolveCommand ( pm , 'run' , [ 'dev' ] ) ;
5959
60- let msg = 'Done!\n' ;
61- msg += ` To get started run:\n\n` ;
60+ const steps : string [ ] = [ ] ;
61+ const shouldCd = ( ! shouldInstall && ! ! installCmd ) || ! ! runCmd || ! ! cdPath ;
62+ if ( shouldCd && cdPath ) {
63+ steps . push ( ` cd ${ cdPath } ` ) ;
64+ }
6265 if ( ! shouldInstall && installCmd ) {
63- msg += ` cd ${ cdPath } \n` ;
64- msg += ` ${ installCmd . command } ${ installCmd . args . join ( ' ' ) } \n` ;
65- } else if ( cdPath ) {
66- msg += ` cd ${ cdPath } \n` ;
66+ steps . push ( ` ${ installCmd . command } ${ installCmd . args . join ( ' ' ) } ` ) ;
6767 }
6868 if ( runCmd ) {
69- msg += ` ${ runCmd . command } ${ runCmd . args . join ( ' ' ) } ` ;
69+ steps . push ( ` ${ runCmd . command } ${ runCmd . args . join ( ' ' ) } ` ) ;
70+ }
71+
72+ let msg = 'Done!\n' ;
73+ if ( steps . length > 0 ) {
74+ msg += ` To get started run:\n\n` ;
75+ msg += steps . join ( '\n' ) ;
7076 }
7177
7278 p . outro ( msg ) ;
Original file line number Diff line number Diff line change @@ -58,7 +58,7 @@ export function pmInstall(pm: Agent) {
5858 failAndExit ( `Cannot resolve install command for ${ pm } ` ) ;
5959 }
6060
61- const label = `${ cmd . command } ${ cmd . args . join ( ' ' ) } ` ;
61+ const label = `${ cmd . command } ${ cmd . args . length ? ` ${ cmd . args . join ( ' ' ) } ` : '' } ` ;
6262 p . log . step ( `Running ${ label } ...` ) ;
6363 runCommand ( cmd . command , cmd . args , true ) ;
6464 p . log . success ( 'Installed dependencies.' ) ;
You can’t perform that action at this time.
0 commit comments