2
0
mirror of https://github.com/alexanderepstein/Bash-Snippets synced 2018-11-08 02:59:35 +01:00

Not using getConfiguredPython on OSX

This commit is contained in:
Alex Epstein 2017-07-24 15:02:30 -04:00
parent ac472d04ae
commit 3f40fdcae2
3 changed files with 30 additions and 24 deletions

View File

@ -34,13 +34,15 @@ getConfiguredPython()
} }
python() if [[ $(uname) != "Darwin" ]];then
{ python()
case "$configuredPython" in {
python2) python2 "$@";; case "$configuredPython" in
python) python "$@";; python2) python2 "$@";;
esac python) python "$@";;
} 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()
@ -154,7 +156,7 @@ usage()
echo " movies Inception" echo " movies Inception"
} }
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

View File

@ -35,13 +35,15 @@ getConfiguredPython()
} }
python() if [[ $(uname) != "Darwin" ]];then
{ python()
case "$configuredPython" in {
python2) python2 "$@";; case "$configuredPython" in
python) python "$@";; python2) python2 "$@";;
esac python) python "$@";;
} 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()
@ -142,7 +144,7 @@ printResults()
echo "=====================================================================" echo "====================================================================="
} }
getConfiguredPython || exit 1 if [[ $(uname) != "Darwin" ]];then getConfiguredPython || exit 1;fi
getConfiguredClient || exit 1 getConfiguredClient || exit 1
checkInternet || exit 1 checkInternet || exit 1

View File

@ -37,13 +37,15 @@ getConfiguredPython()
} }
python() if [[ $(uname) != "Darwin" ]];then
{ python()
case "$configuredPython" in {
python2) python2 "$@";; case "$configuredPython" in
python) python "$@";; python2) python2 "$@";;
esac python) python "$@";;
} 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()
@ -205,7 +207,7 @@ if [[ $apiKey == "" ]];then
echo "After following all the steps and issues still persist try adding export TASTE_API_KEY manually to your .bash_profile" echo "After following all the steps and issues still persist try adding export TASTE_API_KEY manually to your .bash_profile"
exit 1 exit 1
fi fi
getConfiguredPython || exit 1 if [[ $(uname) != "Darwin" ]];then getConfiguredPython || exit 1;fi
getConfiguredClient || exit 1 getConfiguredClient || exit 1
checkInternet || exit 1 checkInternet || exit 1