From ac472d04aea83dd8dd7dc90d8189a979fa45f524 Mon Sep 17 00:00:00 2001 From: Alex Epstein Date: Mon, 24 Jul 2017 13:53:30 -0400 Subject: [PATCH] Fixing bug in stocks for OSX, only create python function conditionally --- stocks/stocks | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/stocks/stocks b/stocks/stocks index dea4536..7537515 100755 --- a/stocks/stocks +++ b/stocks/stocks @@ -33,14 +33,15 @@ getConfiguredPython() fi } - -python() -{ - case "$configuredPython" in - python2) python2 "$@";; - python) python "$@";; - esac -} +if [[ $(uname) != "Darwin" ]];then + python() + { + case "$configuredPython" in + python2) python2 "$@";; + python) python "$@";; + esac + } +fi ## Allows to call the users configured client without if statements everywhere httpGet() @@ -164,7 +165,7 @@ usage() echo " stocks Tesla" } -getConfiguredPython || exit 1 +if [[ $(uname) != "Darwin" ]];then getConfiguredPython || exit 1;fi 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