Skip to content

Commit

Permalink
Merge pull request #380 from cantino/revert-379-chore/drop-homebrew-tap
Browse files Browse the repository at this point in the history
Revert "Drop custom homebrew tap"
  • Loading branch information
cantino authored Dec 3, 2023
2 parents 82c4fd0 + 56fa91b commit e5ad467
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ description = "McFly replaces your default ctrl-r shell history search with an i
license = "MIT"
repository = "https://github.com/cantino/mcfly"
categories = ["command-line-utilities"]
exclude = ["docs/*"]
exclude = ["HomebrewFormula", "HomebrewFormula/*", "pkg/*", "docs/*"]

[profile.release]
lto = true
Expand Down
1 change: 1 addition & 0 deletions HomebrewFormula
17 changes: 15 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,13 @@ When suggesting a command, McFly takes into consideration:

### Install with Homebrew (on OS X or Linux)

1. Install the tap:
```bash
brew tap cantino/mcfly
```
1. Install `mcfly`:
```bash
brew install mcfly
brew install cantino/mcfly/mcfly
```
1. Add the following to the end of your `~/.bashrc`, `~/.zshrc`, or `~/.config/fish/config.fish` file:

Expand All @@ -71,6 +75,10 @@ When suggesting a command, McFly takes into consideration:
```bash
brew uninstall mcfly
```
1. Remove the tap:
```bash
brew untap cantino/mcfly
```
1. Remove the lines you added to `~/.bashrc` / `~/.zshrc` / `~/.config/fish/config.fish`.

### Install with MacPorts (on OS X)
Expand Down Expand Up @@ -427,5 +435,10 @@ Contributions and bug fixes are encouraged! However, we may not merge PRs that i
1. `git push origin head --tags`
1. Let the build finish.
1. Edit the new Release on Github.
1. Edit `pkg/brew/mcfly.rb` and update the version and SHAs. (`shasum -a 256 ...`)
1. Edit `../homebrew-mcfly/pkg/brew/mcfly.rb` too.
1. `cp pkg/brew/mcfly.rb ../homebrew-mcfly/pkg/brew/mcfly.rb`
1. Compare with `diff ../homebrew-mcfly/pkg/brew/mcfly.rb ../mcfly/pkg/brew/mcfly.rb ; diff ../homebrew-mcfly/HomebrewFormula/mcfly.rb ../mcfly/HomebrewFormula/mcfly.rb`
1. `git add -p && git ci -m 'Update homebrew' && git push`
1. `cd ../homebrew-mcfly && git add -p && git ci -m 'Update homebrew' && git push && cd ../mcfly`
1. `cargo publish`
1. TBD: update homebrew-core Formula at https://github.com/Homebrew/homebrew-core/blob/master/Formula/m/mcfly.rb
44 changes: 44 additions & 0 deletions pkg/brew/mcfly.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# To install:
# brew tap cantino/mcfly
# brew install mcfly
#
# To remove:
# brew uninstall mcfly
# brew untap cantino/mcfly

class Mcfly < Formula
version 'v0.8.1'
desc "McFly"
homepage "https://github.com/cantino/mcfly"

if OS.mac?
url "https://github.com/cantino/mcfly/releases/download/#{version}/mcfly-#{version}-x86_64-apple-darwin.tar.gz"
sha256 "db8d125c040fa9f97ba9b7777d1109ff2598db386f42e79e24aef66556500c11"
elsif OS.linux?
url "https://github.com/cantino/mcfly/releases/download/#{version}/mcfly-#{version}-x86_64-unknown-linux-musl.tar.gz"
sha256 "31231a4085f73eef41ab222e08518b7912cce55e7c1396931818a0fbfacf4fef"
end

def install
bin.install "mcfly"
end

def caveats
<<~EOS
ONE MORE STEP!
Add the following to the end of your ~/.bashrc, ~/.zshrc, or ~/.config/fish/config.fish file.
Bash:
eval "$(mcfly init bash)"
Zsh:
eval "$(mcfly init zsh)"
Fish:
mcfly init fish | source
You will need to restart your terminal when first installing and on some updates. If you receive a McFly error when running commands, try restarting your terminal.
EOS
end
end

0 comments on commit e5ad467

Please sign in to comment.