Last active
January 12, 2024 19:04
-
-
Save wrkhenddher/cf595cb3565ee277ee11b5d52db637c7 to your computer and use it in GitHub Desktop.
Homebrew pre-commit 2.21.0 (3.x.x breaks with existing .pre-commit-config.yaml)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
```shell | |
$ brew tap-new $USER/local--pre-commit | |
``` | |
```shell | |
Initialized empty Git repository in /opt/homebrew/Library/Taps/henddher/homebrew-local--pre-commit/.git/ | |
`.pre-commit-config.yaml` config file not found. Skipping `pre-commit`. | |
[main (root-commit) 5f52df2] Create henddher/local--pre-commit tap | |
3 files changed, 90 insertions(+) | |
create mode 100644 .github/workflows/publish.yml | |
create mode 100644 .github/workflows/tests.yml | |
create mode 100644 README.md | |
==> Created henddher/local--pre-commit | |
/opt/homebrew/Library/Taps/henddher/homebrew-local--pre-commit | |
When a pull request making changes to a formula (or formulae) becomes green | |
(all checks passed), then you can publish the built bottles. | |
To do so, label your PR as `pr-pull` and the workflow will be triggered. | |
``` | |
```shell | |
file "$(brew --repo homebrew/core)" | |
``` | |
*IF* | |
``` | |
/opt/homebrew/Library/Taps/homebrew/homebrew-core: cannot open `/opt/homebrew/Library/Taps/homebrew/homebrew-core' (No such file or directory) | |
``` | |
*THEN* | |
```shell | |
brew tap homebrew/core | |
``` | |
*FI* | |
```shell | |
brew extract --version=2.21.0 pre-commit $USER/local--pre-commit | |
``` | |
```shell | |
brew search pre-commit | |
==> Formulae | |
henddher/local--pre-commit/pre-commit@2.21.0 pre-commit ✔ | |
``` | |
*IF* | |
```shell | |
pre-commit --version | |
``` | |
``` | |
pre-commit 3.2.2 | |
``` | |
*THEN* | |
```shell | |
brew unlink pre-commit | |
``` | |
``` | |
Unlinking /opt/homebrew/Cellar/pre-commit/3.2.2... 1 symlinks removed. | |
``` | |
*FI* | |
```shell | |
brew install pre-commit@2.21.0 | |
``` | |
``` | |
brew link pre-commit@2.21.0 | |
``` | |
```shell | |
pre-commit --version | |
``` | |
``` | |
pre-commit 2.21.0 | |
``` | |
```shell | |
brew pin pre-commit@2.21.0 | |
``` |
Uninstall:
brew unpin pre-commit@2.21.0
brew uninstall pre-commit@2.21.0
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Refs:
https://github.com/orgs/Homebrew/discussions/4326
https://blog.sandipb.net/2021/09/02/installing-a-specific-version-of-a-homebrew-formula/
https://stackoverflow.com/questions/3987683/homebrew-install-specific-version-of-formula/9832084#9832084