2 # homepage: https://github.com/BurntSushi/ripgrep
3 # tagline: a modern drop-in grep replacement
6 # `rg` is a drop-in replacement for `grep`, that respects `.gitignore` and `.ignore`, has all of the sensible default options you want (colors, numbers, etc) turned on by default, is written in Rust, and simply outperforms grep in every imaginable way. R.I.P. grep.
10 # rg <search-term> # searches recursively, ignoing .git, node_modules, etc
14 # rg 'function doStuff'
28 new_rg="${HOME}/.local/bin/rg"
30 # Test for existing version
32 cur_rg="$(command -v rg)"
34 if [ -n "$cur_rg" ]; then
35 cur_ver=$(rg --version | head -n 1 | cut -d ' ' -f 2)
36 if [ "$cur_ver" == "$WEBI_VERSION" ]; then
37 echo "ripgrep v$WEBI_VERSION already installed at $cur_rg"
39 elif [ "$cur_rg" != "$new_rg" ]; then
40 echo "WARN: possible conflict with ripgrep v$WEBI_VERSION at $cur_rg"
44 # Note: this file is `source`d by the true installer and hence will have the webi functions
46 # because we created releases.js we can use webi_download()
47 # downloads ripgrep to ~/Downloads
50 # because this is tar or zip, we can webi_extract()
51 # extracts to the WEBI_TMP directory, raw (no --strip-prefix)
54 pushd "$WEBI_TMP" 2>&1 >/dev/null
55 echo Installing ripgrep v${WEBI_VERSION} as "$new_rg"
56 mv ./ripgrep-*/rg "$HOME/.local/bin/"
63 # TODO get better output from pathman / output the path to add as return to webi bootstrap
64 webi_path_add "$HOME/.local/bin"