Skip to content

Commit

Permalink
[5.x] Remove php artisan pail from composer run dev on Windows (#366
Browse files Browse the repository at this point in the history
)

* [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]>
  • Loading branch information
3 people authored Nov 18, 2024
1 parent c4508ea commit 58867dd
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/NewCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,8 @@ protected function execute(InputInterface $input, OutputInterface $output): int
$output->writeln('');
}

$this->configureComposerDevScript($directory);

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

/**
* Configure the Composer "dev" script.
*
* @param string $directory
* @return void
*/
protected function configureComposerDevScript(string $directory): void
{
$this->composer->modify(function (array $content) {
if (windows_os()) {
$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'";
}

return $content;
});
}

/**
* Verify that the application does not already exist.
*
Expand Down

0 comments on commit 58867dd

Please sign in to comment.