Skip to content

Commit

Permalink
Add conditional for brew gnu-sed on MacOS
Browse files Browse the repository at this point in the history
  • Loading branch information
vikingops committed Aug 6, 2018
1 parent fcc340b commit 954752e
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 5 deletions.
5 changes: 4 additions & 1 deletion utilities/add_new_event.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,13 @@ cd `dirname ${0}`

# Detect OS for correct 'sed' syntax
OSNAME=`uname`
GNUSED=$(which sed)
SEDCMD(){
if [[ $OSNAME == 'Linux' ]]; then
sed -i "$@"
elif [[ $OSNAME == 'Darwin' ]]; then
elif [[ $OSNAME == 'Darwin' && $GNUSED == '/usr/local/bin/sed' ]]; then
sed -i "$@"
else
sed -i '' "$@"
fi
}
Expand Down
5 changes: 4 additions & 1 deletion utilities/add_organizers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,13 @@ OUT=$(mktemp /tmp/output.XXXXXXXXXX) || { echo "Failed to create temp file"; exi

# Detect OS for correct 'sed' syntax
OSNAME=`uname`
GNUSED=$(which sed)
SEDCMD(){
if [[ $OSNAME == 'Linux' ]]; then
sed -i "$@"
elif [[ $OSNAME == 'Darwin' ]]; then
elif [[ $OSNAME == 'Darwin' && $GNUSED == '/usr/local/bin/sed' ]]; then
sed -i "$@"
else
sed -i '' "$@"
fi
}
Expand Down
5 changes: 4 additions & 1 deletion utilities/add_program.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,13 @@ cd `dirname ${0}`

# Detect OS for correct 'sed' syntax
OSNAME=`uname`
GNUSED=$(which sed)
SEDCMD(){
if [[ $OSNAME == 'Linux' ]]; then
sed -i "$@"
elif [[ $OSNAME == 'Darwin' ]]; then
elif [[ $OSNAME == 'Darwin' && $GNUSED == '/usr/local/bin/sed' ]]; then
sed -i "$@"
else
sed -i '' "$@"
fi
}
Expand Down
5 changes: 4 additions & 1 deletion utilities/add_speakers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,13 @@ cd `dirname ${0}`

# Detect OS for correct 'sed' syntax
OSNAME=`uname`
GNUSED=$(which sed)
SEDCMD(){
if [[ $OSNAME == 'Linux' ]]; then
sed -i "$@"
elif [[ $OSNAME == 'Darwin' ]]; then
elif [[ $OSNAME == 'Darwin' && $GNUSED == '/usr/local/bin/sed' ]]; then
sed -i "$@"
else
sed -i '' "$@"
fi
}
Expand Down
5 changes: 4 additions & 1 deletion utilities/add_sponsors.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,13 @@ set -e
cd `dirname ${0}`
# Detect OS for correct 'sed' syntax
OSNAME=`uname`
GNUSED=$(which sed)
SEDCMD(){
if [[ $OSNAME == 'Linux' ]]; then
sed -i "$@"
elif [[ $OSNAME == 'Darwin' ]]; then
elif [[ $OSNAME == 'Darwin' && $GNUSED == '/usr/local/bin/sed' ]]; then
sed -i "$@"
else
sed -i '' "$@"
fi
}
Expand Down

0 comments on commit 954752e

Please sign in to comment.