Skip to content

Commit

Permalink
Fix for directories with spaces (#147)
Browse files Browse the repository at this point in the history
  • Loading branch information
evanbarter authored Sep 8, 2020
1 parent e860aad commit ef8e322
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/NewCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -114,7 +114,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
$output->writeln(PHP_EOL.'<comment>Application ready! Build something amazing.</comment>');
}

return 0;
return $process->getExitCode();
}

/**
Expand Down
2 changes: 1 addition & 1 deletion tests/NewCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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\"");
}
}

Expand Down

0 comments on commit ef8e322

Please sign in to comment.