core: Install bat/delta

This commit is contained in:
2020-08-28 15:53:01 +01:00
parent 0fd7983744
commit 049065ea25
5 changed files with 46 additions and 13 deletions

11
install_bat.bash Normal file
View File

@@ -0,0 +1,11 @@
BAT_VER=v0.15.4
install_bat() {
if [ "$(uname -s)" == 'Darwin' ]; then
bat_PATH=bat-${BAT_VER}-x86_64-apple-darwin
elif [ "$(uname -s)" == 'Linux' ] ; then
bat_PATH=bat-${BAT_VER}-x86_64-unknown-linux-gnu
fi
bat_URL=https://github.com/sharkdp/bat/releases/download/${BAT_VER}/${bat_PATH}.tar.gz
echo "Installing bat $bat_PATH"
((curl -L ${bat_URL} | tar xzf - "${bat_PATH}/bat") && mv ${bat_PATH}/bat $BASE/bin/bat-${BAT_VER} && ln -sf $BASE/bin/bat-${BAT_VER} $BASE/bin/bat && rm -r ${bat_PATH}) || exit 1
}