Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[7.x] Normalize directory separator on ChromeDriverCommand #1045

Merged
merged 1 commit into from
Jul 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/Console/ChromeDriverCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,10 @@ protected function extract($version, $archive)
*/
protected function rename($binary, $os)
{
$newName = Str::contains($binary, DIRECTORY_SEPARATOR)
? Str::after(str_replace('chromedriver', 'chromedriver-'.$os, $binary), DIRECTORY_SEPARATOR)
$binary = str_replace(DIRECTORY_SEPARATOR, '/', $binary);

$newName = Str::contains($binary, '/')
? Str::after(str_replace('chromedriver', 'chromedriver-'.$os, $binary), '/')
: str_replace('chromedriver', 'chromedriver-'.$os, $binary);

rename($this->directory.$binary, $this->directory.$newName);
Expand Down
2 changes: 2 additions & 0 deletions testbench.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
providers:
- Laravel\Dusk\DuskServiceProvider
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not required to fix the bug but would allow us to run and test dusk:chrome-driver command while developing the package. Usage:

vendor/bin/testbench dusk:chrome-driver --all