From 0887152e2e0f4033d33f83b35fb88a78eb2e3dd5 Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Fri, 26 Aug 2016 16:37:13 -0700 Subject: [PATCH] Add command_exists function --- dotfiles/lib/setup_functions.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dotfiles/lib/setup_functions.sh b/dotfiles/lib/setup_functions.sh index 55ec8840..ed753802 100644 --- a/dotfiles/lib/setup_functions.sh +++ b/dotfiles/lib/setup_functions.sh @@ -34,3 +34,7 @@ function environment_variable_exists { eval "value=\"\${$1+x}\"" [ ! -z $value ] } + +function command_exists { + hash "$1" 2>/dev/null 1>/dev/null +}