Skip to content

Commit

Permalink
Add sed checks to startup.sh script #166
Browse files Browse the repository at this point in the history
  • Loading branch information
ongrid committed Nov 22, 2020
1 parent 89240f8 commit bbf4322
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions e2e/startup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,22 @@ while test $# -gt 0; do
esac
done

if [ -d "/usr/local/opt/gnu-sed/libexec/gnubin" ]; then
echo "It seems we are on MacOS X with brew and gnu sed installed"
echo "Using it as the default sed"
PATH="/usr/local/opt/gnu-sed/libexec/gnubin:$PATH"
fi

TEMPFILE=".tmp_sed_check"
echo oldtext > $TEMPFILE && grep -q "oldtext" $TEMPFILE
if sed -i "s/old/new/" $TEMPFILE && grep -q "newtext" $TEMPFILE; then
echo "sed behaves good"
else
echo "it seems, you are on MacOS X. You should install brew and GNU version of sed utility"
echo "brew install gnu-sed"
exit
fi

if [[ $RESET ]]; then
echo "Cleanup"
docker-compose down -v --remove-orphans
Expand Down

0 comments on commit bbf4322

Please sign in to comment.