@@ -66,7 +66,7 @@ class NewCommand extends PWConnector {
6666 'userpass ' => '' ,
6767 'userpass_confirm ' => '' ,
6868 'useremail ' => '' ,
69- 'color ' => 'classic ' ,
69+ 'color ' => 'classic '
7070 );
7171
7272 /**
@@ -82,6 +82,7 @@ protected function configure() {
8282 ->setName ('new ' )
8383 ->setDescription ('Creates a new ProcessWire project ' )
8484 ->addArgument ('directory ' , InputArgument::OPTIONAL , 'Directory where the new project will be created ' )
85+ ->addOption ('force ' , null , InputOption::VALUE_NONE , 'Force installation in an non empty directory ' )
8586 ->addOption ('dbUser ' , null , InputOption::VALUE_REQUIRED , 'Database user ' )
8687 ->addOption ('dbPass ' , null , InputOption::VALUE_OPTIONAL , 'Database password ' )
8788 ->addOption ('dbName ' , null , InputOption::VALUE_REQUIRED , 'Database name ' )
@@ -410,9 +411,10 @@ private function download($branch) {
410411 * @throws \RuntimeException if the downloaded archive could not be extracted
411412 */
412413 private function extract () {
414+ $ forceInstall = $ this ->input ->getOption ('force ' );
413415 $ this ->tools ->writeBlockBasic ('Preparing project... ' );
414416 $ cfp = $ this ->src ? $ this ->src : $ this ->compressedFilePath ;
415- $ this ->downloader ->extract ($ cfp , $ this ->projectDir , $ this ->getName ());
417+ $ this ->downloader ->extract ($ cfp , $ this ->projectDir , $ this ->getName (), $ forceInstall );
416418
417419 return $ this ;
418420 }
0 commit comments