From 75150f118a6e01b90102f14d170ffecbe1946db6 Mon Sep 17 00:00:00 2001 From: Mior Muhammad Zaki Date: Fri, 21 Jul 2023 21:44:51 +0800 Subject: [PATCH] wip Signed-off-by: Mior Muhammad Zaki --- src/UpdateCommand.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/UpdateCommand.php b/src/UpdateCommand.php index 511aa39..86e569b 100644 --- a/src/UpdateCommand.php +++ b/src/UpdateCommand.php @@ -134,7 +134,9 @@ protected function rename(string $binary, string $os): void throw new RuntimeException("Unable to rename {$binary} without --install-dir"); } - $newName = array_reverse(explode(DIRECTORY_SEPARATOR, str_replace('chromedriver', 'chromedriver-'.$os, $binary), 2))[0]; + $newName = strpos($binary, DIRECTORY_SEPARATOR) >= 0 + ? array_reverse(explode(DIRECTORY_SEPARATOR, str_replace('chromedriver', 'chromedriver-'.$os, $binary), 2))[0] + : str_replace('chromedriver', 'chromedriver-'.$os, $binary); rename($this->directory.$binary, $this->directory.$newName);