Now ensures the user has required binaries before trying to set git hook.

This commit is contained in:
William Boman 2015-02-20 00:12:55 +01:00
parent 3800e24870
commit 2ca918fd2f

View file

@ -1,5 +1,13 @@
#!/bin/sh
check_command() {
command -v "$1" > /dev/null 2>&1 || { echo "git-stats hook script requires the \`${1}\` binary in order to run." >&2; exit 1; }
}
check_command "perl"
check_command "printf"
check_command "git"
echo "Setting up git-stats hooks.";
git_templates_dir=$(git config --global --get init.templatedir);