You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
961 B
Plaintext
28 lines
961 B
Plaintext
3 years ago
|
#!/usr/bin/env bash
|
||
|
|
||
|
source "${XDG_DATA_HOME}/buddy-up/includes/utils.sh"
|
||
|
|
||
|
function get_os () {
|
||
|
case $(uname -s) in
|
||
|
Linux*) echo unknown-linux-musl;;
|
||
|
Darwin*) echo apple-darwin;;
|
||
|
*) >&2 echo "unsupported os: $(uname -s)"; exit 1;;
|
||
|
esac
|
||
|
}
|
||
|
|
||
|
APP=rg
|
||
|
VERSION=${VERSION:-13.0.0}
|
||
|
DEST="${XDG_DATA_HOME}/apps/releases/${APP}"
|
||
|
URL=https://github.com/BurntSushi/ripgrep/releases/download/${VERSION}/ripgrep-${VERSION}-$(uname -m)-$(get_os).tar.gz
|
||
|
|
||
|
extract_tarball "${URL}" "${DEST}/${VERSION}" "--strip-component 1"
|
||
|
set_current_link "${DEST}" "${VERSION}"
|
||
|
|
||
2 years ago
|
mkdir_if_missing "${XDG_CONFIG_HOME}/bash/bashrc.d"
|
||
|
mkdir_if_missing "${XDG_CONFIG_HOME}/fish/completions"
|
||
|
|
||
3 years ago
|
set_link "${XDG_BIN_HOME}/rg" "${DEST}" rg
|
||
3 years ago
|
set_link "${MAN_DIR}/rg.1" "${DEST}" doc/rg.1
|
||
3 years ago
|
set_link "${XDG_CONFIG_HOME}/bash/bashrc.d/ripgrep.sh" "${DEST}" complete/rg.bash
|
||
3 years ago
|
set_link "${XDG_CONFIG_HOME}/fish/completions/ripgrep.fish" "${DEST}" complete/rg.fish
|