Created
June 3, 2020 21:28
-
-
Save PezCoder/72ba0f5eba3ca5dc7271bde1a1fcfe5e to your computer and use it in GitHub Desktop.
Install ripgrep using homebrew
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
#!/bin/bash | |
set -e | |
# Utility functions | |
## For ease of iterative experimentation | |
doo () { | |
$@ | |
# echo $@ | |
} | |
command_exists () { | |
type "$1" &> /dev/null ; | |
} | |
installed () { | |
echo -e " ✓ $1 already installed." | |
} | |
# START HERE. | |
main () { | |
install_rg | |
} | |
install_rg () { | |
if !(command_exists rg); then | |
doo brew tap burntsushi/ripgrep https://github.com/BurntSushi/ripgrep.git | |
doo brew install burntsushi/ripgrep/ripgrep-bin | |
else | |
installed 'rg' | |
fi | |
} | |
# Fire missiles | |
main |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment