diff --git a/release.sh b/release.sh index 53ed43e..d4979bb 100755 --- a/release.sh +++ b/release.sh @@ -35,9 +35,12 @@ git checkout --detach make setup dist git add dist/ -# Edit package.json and bower.json to the right version -sed -i "" -E 's|"version": "[^"]+",|"version": "'$VERSION'",|' package.json -sed -i "" -E 's|"version": "[^"]+",|"version": "'$VERSION'",|' bower.json +# Edit package.json and bower.json to the right version (see +# http://stackoverflow.com/a/22084103 for why we need the .bak file to make +# this mac & linux compatible) +sed -i.bak 's|"version": "[^"]+",|"version": "'$VERSION'",|' package.json +sed -i.bak -E 's|"version": "[^"]+",|"version": "'$VERSION'",|' bower.json +rm -f package.json.bak bower.json.bak # Make the commit and tag, and push them. git add package.json bower.json @@ -53,8 +56,9 @@ if [ ! -z "$NEXT_VERSION" ]; then git checkout master # Edit package.json and bower.json to the right version - sed -i "" -E 's|"version": "[^"]+",|"version": "'$NEXT_VERSION'-pre",|' package.json - sed -i "" -E 's|"version": "[^"]+",|"version": "'$NEXT_VERSION'-pre",|' bower.json + sed -i.bak -e 's|"version": "[^"]+",|"version": "'$NEXT_VERSION'-pre",|' package.json + sed -i.bak -e 's|"version": "[^"]+",|"version": "'$NEXT_VERSION'-pre",|' bower.json + rm -f package.json.bak bower.json.bak git add package.json bower.json git commit -n -m "Bump master to v$NEXT_VERSION-pre"