From 6a707db5685c2a90e0dddab3c680cb4f4eb3231c Mon Sep 17 00:00:00 2001 From: Phil Cook Date: Wed, 2 Apr 2014 19:26:35 +0100 Subject: [PATCH] Fixed issue #3 by adding if statement to catch if a variable passed in or not. --- phpswitch.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/phpswitch.sh b/phpswitch.sh index 9b778e8..a596934 100644 --- a/phpswitch.sh +++ b/phpswitch.sh @@ -11,6 +11,13 @@ php_opt_path="$brew_prefix\/opt\/" php_lib_path="\/libexec\/apache2\/libphp5.so" php_mod_path="$php_opt_path$php_version$php_lib_path" +# Has the user submitted a version required +if [[ -z "$1" ]] +then + echo "Please set which version you want to switch to. E.g. brew-php-switcher 53" + exit +fi + # What versions of php are installed via brew for i in ${php_array[@]} do