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 25, 2020
1 parent 7299e77 commit 7441ffd
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions e2e/startup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,24 @@ 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 instead the system 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
rm -f $TEMPFILE
echo "sed behaves good"
else
rm -f $TEMPFILE
echo "it seems, you are on MacOS X. You should install brew and GNU version of sed utility"
echo " /bin/bash -c \"$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)\""
echo " brew install gnu-sed"
exit
fi

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

0 comments on commit 7441ffd

Please sign in to comment.