diff --git a/src/Console/ChromeDriverCommand.php b/src/Console/ChromeDriverCommand.php index 1784ebee6..2409d1c25 100644 --- a/src/Console/ChromeDriverCommand.php +++ b/src/Console/ChromeDriverCommand.php @@ -104,7 +104,9 @@ class ChromeDriverCommand extends Command public function handle() { $version = $this->version(); + $all = $this->option('all'); + $currentOS = OperatingSystem::id(); foreach ($this->slugs as $os => $slug) { @@ -145,9 +147,9 @@ protected function version() $version = $this->latestChromeVersion(); } - $url = sprintf($this->versionUrl, $version); - - return trim(file_get_contents($url)); + return trim(file_get_contents( + sprintf($this->versionUrl, $version) + )); } /** @@ -173,10 +175,12 @@ protected function latestChromeVersion() */ protected function download($version, $slug) { - $archive = $this->directory.'chromedriver.zip'; $url = sprintf($this->downloadUrl, $version, $slug); - file_put_contents($archive, fopen($url, 'r')); + file_put_contents( + $archive = $this->directory.'chromedriver.zip', + fopen($url, 'r') + ); return $archive; } @@ -190,7 +194,9 @@ protected function download($version, $slug) protected function extract($archive) { $zip = new ZipArchive; + $zip->open($archive); + $zip->extractTo($this->directory); $binary = $zip->getNameIndex(0); diff --git a/src/Console/InstallCommand.php b/src/Console/InstallCommand.php index dd672391d..92010ce12 100644 --- a/src/Console/InstallCommand.php +++ b/src/Console/InstallCommand.php @@ -58,7 +58,7 @@ public function handle() $this->info('Dusk scaffolding installed successfully.'); - $this->info('Installing ChromeDriver binaries...'); + $this->comment('Downloading ChromeDriver binaries...'); $this->call('dusk:chrome-driver', ['--all' => true]); }