diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2013-09-07 17:32:49 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2013-09-07 17:32:49 +1200 |
commit | 8ad39b0afe4376469d1661c3dc1688cff5302633 (patch) | |
tree | 042b29fa21e12bf71576e32698083a5482f321a6 | |
parent | Include script name in error message (diff) | |
download | dotfiles-8ad39b0afe4376469d1661c3dc1688cff5302633.tar.gz dotfiles-8ad39b0afe4376469d1661c3dc1688cff5302633.zip |
Fail early if we can't find git(1) on install
-rwxr-xr-x | install | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -21,6 +21,12 @@ lns() { return } +# Bail if we don't have git(1) +if ! hash git 2>/dev/null; then + printf '%s: Could not find git(1)!\n' "${0##*/}" >&2 + exit 1 +fi + # Define dotfiles directory and check it exists dotfiles=$HOME/.dotfiles if [[ ! -d $dotfiles ]]; then |