diff --git a/src/NewCommand.php b/src/NewCommand.php index 969f6e83..d0d1e969 100644 --- a/src/NewCommand.php +++ b/src/NewCommand.php @@ -84,15 +84,15 @@ protected function execute(InputInterface $input, OutputInterface $output) if (PHP_OS_FAMILY == 'Windows') { array_unshift($commands, "rd /s /q \"$directory\""); } else { - array_unshift($commands, "rm -rf $directory"); + array_unshift($commands, "rm -rf \"$directory\""); } } if (PHP_OS_FAMILY != 'Windows') { - $commands[] = "chmod 644 $directory/artisan"; + $commands[] = "chmod 644 \"$directory/artisan\""; } - if ($this->runCommands($commands, $input, $output)->isSuccessful()) { + if (($process = $this->runCommands($commands, $input, $output))->isSuccessful()) { if ($name && $name !== '.') { $this->replaceInFile( 'APP_URL=http://localhost', @@ -114,7 +114,7 @@ protected function execute(InputInterface $input, OutputInterface $output) $output->writeln(PHP_EOL.'Application ready! Build something amazing.'); } - return 0; + return $process->getExitCode(); } /** diff --git a/tests/NewCommandTest.php b/tests/NewCommandTest.php index 5faae00d..52c5939d 100644 --- a/tests/NewCommandTest.php +++ b/tests/NewCommandTest.php @@ -18,7 +18,7 @@ public function test_it_can_scaffold_a_new_laravel_app() if (PHP_OS_FAMILY == 'Windows') { exec("rd /s /q \"$scaffoldDirectory\""); } else { - exec("rm -rf $scaffoldDirectory"); + exec("rm -rf \"$scaffoldDirectory\""); } }