Skip to content

Instantly share code, notes, and snippets.

@felipevolpatto
Created September 27, 2018 17:59
Show Gist options
  • Save felipevolpatto/94273ba757a78bcb760331032411ab23 to your computer and use it in GitHub Desktop.
Save felipevolpatto/94273ba757a78bcb760331032411ab23 to your computer and use it in GitHub Desktop.
Install ripgrep on Ubuntu
#!/bin/bash
[[ $UID == 0 ]] || { echo "run as sudo to install"; exit 1; }
REPO="https://github.com/BurntSushi/ripgrep/releases/download/"
RG_LATEST=$(curl -sSL "https://api.github.com/repos/BurntSushi/ripgrep/releases/latest" | jq --raw-output .tag_name)
RELEASE="${RG_LATEST}/ripgrep-${RG_LATEST}-x86_64-unknown-linux-musl.tar.gz"
TMPDIR=$(mktemp -d)
cd $TMPDIR
wget -O - ${REPO}${RELEASE} | tar zxf - --strip-component=1
mv rg /usr/local/bin/
mv rg.1 /usr/local/share/man/man1/
mv complete/rg.bash-completion /usr/share/bash-completion/completions/rg
mandb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment