Skip to content

Instantly share code, notes, and snippets.

@drbyte
Created May 23, 2020 03:51
Show Gist options
  • Save drbyte/ba5680ee93ae24c2bc7938afea08931f to your computer and use it in GitHub Desktop.
Save drbyte/ba5680ee93ae24c2bc7938afea08931f to your computer and use it in GitHub Desktop.

Revisions

  1. drbyte created this gist May 23, 2020.
    19 changes: 19 additions & 0 deletions dusk-chrome-update.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,19 @@
    #!/bin/bash

    # https://chromedriver.storage.googleapis.com/LATEST_RELEASE
    # https://chromedriver.storage.googleapis.com/%s/chromedriver_mac64.zip
    # unzip
    # mv chromedriver /vendor/laravel/dusk/bin/chromedriver-mac

    if [ ! -f "./vendor/laravel/dusk/bin/chromedriver-mac" ]; then echo 'No Dusk Dir.' && exit 1; fi
    a=$(uname -m) &&
    rm -r ~/Downloads/chromedriver/
    mkdir ~/Downloads/chromedriver/ &&
    wget -O ~/Downloads/chromedriver/LATEST_RELEASE https://chromedriver.storage.googleapis.com/LATEST_RELEASE &&
    if [ $a == i686 ]; then b=32; elif [ $a == x86_64 ]; then b=64; fi &&
    latest=$(cat ~/Downloads/chromedriver/LATEST_RELEASE) &&
    wget -O ~/Downloads/chromedriver/chromedriver.zip 'https://chromedriver.storage.googleapis.com/'$latest'/chromedriver_mac'$b'.zip' &&
    #sudo unzip ~/Downloads/chromedriver/chromedriver.zip chromedriver -d /usr/local/bin/ &&
    unzip ~/Downloads/chromedriver/chromedriver.zip chromedriver -d ~/Downloads/chromedriver &&
    mv ~/Downloads/chromedriver/chromedriver vendor/laravel/dusk/bin/chromedriver-mac &&
    echo 'success'