-
Notifications
You must be signed in to change notification settings - Fork 77
Fix Homebrew formula to use HEAD and update docs #38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
- Switch from main branch archive to HEAD to avoid SHA256 mismatches - Update README with correct two-argument tap command - Remove invalid version string - Add note explaining repository naming
cbd1cd0 to
2cdf849
Compare
| homepage "https://github.com/tobi/try" | ||
| url "https://github.com/tobi/try/archive/refs/heads/main.tar.gz" | ||
| sha256 "dd3753f38b5c35597c8c2528a19efd7e4289bbbe977d18e2e299a2a57b393a8e" | ||
| version "main" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried your GitHub branch and installed the formula locally
I got this error:
Error: invalid attribute for formula 'xxx/try/try': version (nil)
Final code that works:
class Try < Formula
desc "Fresh directories for every vibe - lightweight experiments for people with ADHD"
homepage "https://github.com/hirotaka/try"
head "https://github.com/hirotaka/try.git", branch: "fix-homebrew-formula"
url "https://github.com/tobi/try/archive/refs/heads/main.tar.gz"
version "main"
depends_on "ruby"
def install
bin.install "try.rb" => "try"
end
def caveats
<<~EOS
To set up try with your shell, add one of the following to your shell configuration:
For bash/zsh:
eval "$(try init ~/src/tries)"
For fish:
eval "(try init ~/src/tries | string collect)"
You can change ~/src/tries to any directory where you want your experiments stored.
EOS
end
test do
system "#{bin}/try", "--help"
end
endThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
brew tap tobi/try https://github.com/tobi/try is indeed necessary, otherwise brew attempts to clone https://github.com/tobi/homebrew-try which does not exist.
|
Seems like there is also an issue with the checksum Error: Formula reports different checksum: 151778fdd07adac23fb021d2d84bd0756e0d626a97498503da24413bfdd72c28 |
What's the problem?
When following the README instructions and running
brew tap tobi/try, I got this error:This happens because there's no
homebrew-tryrepository. The repo is namedtry, which doesn't follow Homebrew's naming convention (homebrew-*).Then I tried
brew install trydirectly instead, I got a SHA256 mismatch error:This is because the formula uses an archive URL for the main branch (
archive/refs/heads/main.tar.gz), so the hash changes every time main is updated.How this fixes it
Formula/try.rb: Switch to using
headurlandsha256(these were causing the mismatch)version "main"(invalid version string)headto reference the main branch directlyREADME.md: Updated with correct installation instructions
brew tapcommand (explains why full URL is needed)How to install now
I hope it should work now!