Install a previous version of chromedriver with brew

半腔热情 提交于 2021-02-11 13:59:11

问题


I want to install chromedriver version 79.0.3945.36 with brew. When I try to run

 brew cask install chromedriver@79.0.3945.36

It fails saying chromedriver@79.0.3945.36 is unavailable: No Cask with this name exists.


回答1:


I did a quick check, did not find cask formula has versioned ones.

The hack way of installing a old version of cask formula would be:

  • cd /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask, go the place where cask is referenced
  • git reset --hard c3c1b84b7a, this would effective set chromedriver to v79.0.3945.36
  • git checkout -b temp, checkout a new branch, which prevents brew auto-refresh your local master
  • brew cask install chromedriver, this would install your desired version.

After that you can always do git checkout master and brew up to keep in sync with the latest master of homebrew-cask.

here is my installation log

==> Downloading https://chromedriver.storage.googleapis.com/79.0.3945.36/chromedriver_mac64.zip
Already downloaded: /Users/rchen/Library/Caches/Homebrew/downloads/2712e559b7e0712e196b123a7581adecc2cfdc8d8d728b01fd875b3d371e5d29--chromedriver_mac64.zip
==> Verifying SHA-256 checksum for Cask 'chromedriver'.
==> Installing Cask chromedriver
==> Linking Binary 'chromedriver' to '/usr/local/bin/chromedriver'.
🍺  chromedriver was successfully installed!

test log:

$ chromedriver --version
ChromeDriver 79.0.3945.36 (3582db32b33893869b8c1339e8f4d9ed1816f143-refs/branch-heads/3945@{#614})


来源:https://stackoverflow.com/questions/62032757/install-a-previous-version-of-chromedriver-with-brew

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!