Fixing bug in stocks for OSX, only create python function conditionally

This commit is contained in:
Alex Epstein 2017-07-24 13:53:30 -04:00
parent 17ce61c349
commit ac472d04ae
1 changed files with 10 additions and 9 deletions

View File

@ -33,14 +33,15 @@ getConfiguredPython()
fi fi
} }
if [[ $(uname) != "Darwin" ]];then
python() python()
{ {
case "$configuredPython" in case "$configuredPython" in
python2) python2 "$@";; python2) python2 "$@";;
python) python "$@";; python) python "$@";;
esac esac
} }
fi
## Allows to call the users configured client without if statements everywhere ## Allows to call the users configured client without if statements everywhere
httpGet() httpGet()
@ -164,7 +165,7 @@ usage()
echo " stocks Tesla" echo " stocks Tesla"
} }
getConfiguredPython || exit 1 if [[ $(uname) != "Darwin" ]];then getConfiguredPython || exit 1;fi
getConfiguredClient || exit 1 getConfiguredClient || exit 1
checkInternet || exit 1 # check if we have a valid internet connection if this isnt true the rest of the script will not work so stop here checkInternet || exit 1 # check if we have a valid internet connection if this isnt true the rest of the script will not work so stop here