Skip to content

Commit ef8e322

Browse files
authored
Fix for directories with spaces (#147)
1 parent e860aad commit ef8e322

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/NewCommand.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,15 +84,15 @@ protected function execute(InputInterface $input, OutputInterface $output)
8484
if (PHP_OS_FAMILY == 'Windows') {
8585
array_unshift($commands, "rd /s /q \"$directory\"");
8686
} else {
87-
array_unshift($commands, "rm -rf $directory");
87+
array_unshift($commands, "rm -rf \"$directory\"");
8888
}
8989
}
9090

9191
if (PHP_OS_FAMILY != 'Windows') {
92-
$commands[] = "chmod 644 $directory/artisan";
92+
$commands[] = "chmod 644 \"$directory/artisan\"";
9393
}
9494

95-
if ($this->runCommands($commands, $input, $output)->isSuccessful()) {
95+
if (($process = $this->runCommands($commands, $input, $output))->isSuccessful()) {
9696
if ($name && $name !== '.') {
9797
$this->replaceInFile(
9898
'APP_URL=http://localhost',
@@ -114,7 +114,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
114114
$output->writeln(PHP_EOL.'<comment>Application ready! Build something amazing.</comment>');
115115
}
116116

117-
return 0;
117+
return $process->getExitCode();
118118
}
119119

120120
/**

tests/NewCommandTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public function test_it_can_scaffold_a_new_laravel_app()
1818
if (PHP_OS_FAMILY == 'Windows') {
1919
exec("rd /s /q \"$scaffoldDirectory\"");
2020
} else {
21-
exec("rm -rf $scaffoldDirectory");
21+
exec("rm -rf \"$scaffoldDirectory\"");
2222
}
2323
}
2424

0 commit comments

Comments
 (0)