Skip to content

Instantly share code, notes, and snippets.

@PezCoder
Created June 3, 2020 21:28
Show Gist options
  • Save PezCoder/72ba0f5eba3ca5dc7271bde1a1fcfe5e to your computer and use it in GitHub Desktop.
Save PezCoder/72ba0f5eba3ca5dc7271bde1a1fcfe5e to your computer and use it in GitHub Desktop.
Install ripgrep using homebrew
#!/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