fw42 / cubecomp

WCA Rubik's Cube competition website hosting
https://cubecomp.de/
MIT License
10 stars 4 forks source link

WCA database script not working on Mac OS X #209

Closed Laura-O closed 8 years ago

Laura-O commented 8 years ago

I installed cubecomp on Max OS X 10.11. When importing the WCA database the update script stops with the error message:

sed: -i may not be used with stdin

This can be fixed by moving the filename to the end of the line:

sed -i -e "s/CHARSET=latin1/CHARSET=utf8/g" $FILENAME

I think that won't work on Linux so I am not creating a pull request for this. Maybe that's something that should be added to the Readme?

fw42 commented 8 years ago

oh yeah, damn. the syntax for sed is slightly different on OS X..

We can make the script itself check if it's running on Linux or Darwin and then do the right thing based on that..

if [[ "$(uname -s)" == "Darwin" ]]; then
  do darwin things
else
  do linux things
fi

this kind of thing. Can you make a PR?