Skip to content

Commit

Permalink
[7.x] Normalize directory separator on ChromeDriverCommand (#1045)
Browse files Browse the repository at this point in the history
fixes #1044

Signed-off-by: Mior Muhammad Zaki <[email protected]>
  • Loading branch information
crynobone authored Jul 27, 2023
1 parent 85e562b commit c726185
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
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

0 comments on commit c726185

Please sign in to comment.