Skip to content

Commit 58867dd

Browse files
crynoboneStyleCIBottaylorotwell
authored
[5.x] Remove php artisan pail from composer run dev on Windows (#366)
* [5.x] Remove `php artisan pail` from `composer run dev` on Windows fixes #365 Signed-off-by: Mior Muhammad Zaki <[email protected]> * Apply fixes from StyleCI * wip Signed-off-by: Mior Muhammad Zaki <[email protected]> * wip Signed-off-by: Mior Muhammad Zaki <[email protected]> * Update NewCommand.php --------- Signed-off-by: Mior Muhammad Zaki <[email protected]> Co-authored-by: StyleCI Bot <[email protected]> Co-authored-by: Taylor Otwell <[email protected]>
1 parent c4508ea commit 58867dd

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

src/NewCommand.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,8 @@ protected function execute(InputInterface $input, OutputInterface $output): int
241241
$output->writeln('');
242242
}
243243

244+
$this->configureComposerDevScript($directory);
245+
244246
$output->writeln(" <bg=blue;fg=white> INFO </> Application ready in <options=bold>[{$name}]</>. You can start your local development using:".PHP_EOL);
245247
$output->writeln('<fg=gray>➜</> <options=bold>cd '.$name.'</>');
246248
$output->writeln('<fg=gray>➜</> <options=bold>npm install && npm run build</>');
@@ -758,6 +760,23 @@ protected function pushToGitHub(string $name, string $directory, InputInterface
758760
$this->runCommands($commands, $input, $output, workingPath: $directory, env: ['GIT_TERMINAL_PROMPT' => 0]);
759761
}
760762

763+
/**
764+
* Configure the Composer "dev" script.
765+
*
766+
* @param string $directory
767+
* @return void
768+
*/
769+
protected function configureComposerDevScript(string $directory): void
770+
{
771+
$this->composer->modify(function (array $content) {
772+
if (windows_os()) {
773+
$content['scripts']['dev'] = "npx concurrently -c \"#93c5fd,#c4b5fd,#fdba74\" \"php artisan serve\" \"php artisan queue:listen --tries=1\" \"npm run dev\" --names='server,queue,vite'";
774+
}
775+
776+
return $content;
777+
});
778+
}
779+
761780
/**
762781
* Verify that the application does not already exist.
763782
*

0 commit comments

Comments
 (0)