起因是用 Homebrew 更新所有软件后,发现 OpenInTerminal 2.2.0无法正常使用所有功能,想回退到2.1.1的版本。

由于此软件并不能通过例如brew cask install openinerminal@2.1.1这样进行指定版本安装,于是去 Github 寻找此软件的.rb提交记录。

软件信息

这里我已经切换完版本了,所以显示最新版本为2.2.0,本地安装版本2.1.1
➜ brew info openinterminal           
Error: No available formula with the name "openinterminal" 
Found a cask named "openinterminal" instead.

openinterminal: 2.2.0
https://github.com/Ji4n1ng/OpenInTerminal
/usr/local/Caskroom/openinterminal/2.1.1 (128B)
From: https://github.com/Homebrew/homebrew-cask/blob/master/Casks/openinterminal.rb
==> Name
OpenInTerminal
==> Artifacts
OpenInTerminal.app (App)

找到来源:https://github.com/Homebrew/homebrew-cask/blob/master/Casks/openinterminal.rb

点击进入后,寻找提交历史时 Github 显示Sorry, this commit history is taking too long to generate.

克隆仓库

只好克隆下整个仓库执行git log master -- Casks/openinterminal.rb,找到所需要版本的提交信息:

commit 8a6c2d4eeaabc9236d802160e517e5007f3b8415
Author: Randall <17261190+ran-dall@users.noreply.github.com>
Date:   Wed Jan 8 15:49:26 2020 -0800

    Update openinterminal from 2.0.5 to 2.1.1 (#75265)

切换到此 Commit:

➜ git checkout 8a6c2d4

然后执行此软件的.rb文件进行安装:

➜ brew cask install ./Casks/openinterminal.rb

此时会安装回2.1.1版本,大功告成。