Add diff-highlight setup script

master
Jordan Atwood 2 years ago
parent ad98e9edea
commit a565aec3b2
Signed by: nightfirecat
GPG Key ID: 615A619C2D73A6DF
  1. 22
      diff-highlight.sh
  2. 7
      setup.sh

@ -0,0 +1,22 @@
#!/usr/bin/env bash
set -e
# don't build diff-highlight if it's already in PATH
if type diff-highlight >/dev/null 2>&1; then
return
fi
# create temp directory
pushd "$(mktemp -d)" >/dev/null
# copy the diff-highlight source files distributed with git to this temp
# directory and build it
cp -R --preserve=mode,timestamps "$(dpkg -L git | grep diff-highlight | head -1)"/* .
make --quiet
# move the created script to ~/.bin, which is in PATH
mv diff-highlight ~/.bin
# remove the temp directory and move back to the previous directory
rm -rf "$(pwd)"
popd >/dev/null

@ -13,9 +13,10 @@ fi
DIR="$( dirname "$(readlink -f "${BASH_SOURCE[0]}")" )" DIR="$( dirname "$(readlink -f "${BASH_SOURCE[0]}")" )"
SRC_DIR="$DIR/src" SRC_DIR="$DIR/src"
POST_SETUP_SCRIPTS=( POST_SETUP_SCRIPTS=(
vscode.sh # install vscode configs vscode.sh # install vscode configs
ssh.sh # set up SSH config and create key if needed ssh.sh # set up SSH config and create key if needed
gpg.sh # create GPG key if needed gpg.sh # create GPG key if needed
diff-highlight.sh # build diff-highlight script from git source
) )
# read file basenames to copy_files array # read file basenames to copy_files array

Loading…
Cancel
Save