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_delta.bash Normal file
View File

@@ -0,0 +1,11 @@
DELTA_VER=0.4.1
install_delta() {
if [ "$(uname -s)" == 'Darwin' ]; then
DELTA_PATH=delta-${DELTA_VER}-x86_64-apple-darwin
elif [ "$(uname -s)" == 'Linux' ] ; then
DELTA_PATH=delta-${DELTA_VER}-x86_64-unknown-linux-gnu
fi
DELTA_URL=https://github.com/dandavison/delta/releases/download/${DELTA_VER}/${DELTA_PATH}.tar.gz
echo "Installing Delta $DELTA_PATH"
((curl -L ${DELTA_URL} | tar xzf - "${DELTA_PATH}/delta") && mv ${DELTA_PATH}/delta $BASE/bin/delta-${DELTA_VER} && ln -sf $BASE/bin/delta-${DELTA_VER} $BASE/bin/delta && rm -r ${DELTA_PATH}) || exit 1
}