Commit baf0197a authored by John A's avatar John A

Remove uname call and replace function with alias

parent 0a99ed07
......@@ -48,13 +48,14 @@ changed=()
seed="$RANDOM"
# ensure MacOS compatibility with GNU getopt
if [ "$(uname)" = 'Darwin' ]; then
GGETOPT=/usr/local/Cellar/gnu-getopt/*/bin/getopt # should link to gnu-getopt
if [[ "$OSTYPE" == 'Darwin'* ]]; then
GGETOPT=/usr/local/Cellar/gnu-getopt/*/bin/getopt # should find gnu-getopt
if [ ! -x $GGETOPT ]; then # file is not executable
printf '%s\n' 'Error: Running on MacOS requires an executable gnu getopt.'
exit 2
fi
getopt() { $GGETOPT "$@"; } # replace getopt with gnu getopt
shopt -s expand_aliases
alias getopt='$GGETOPT' # replace getopt with gnu getopt
fi
# ------ parse options ------
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment