Improve script for Ubuntu

This commit is contained in:
Rodrigo Fernandes 2016-06-27 21:20:51 +01:00
parent 7c79cc32db
commit f500bb09ea

View file

@ -9,8 +9,17 @@ set -e
echo "diff2html updating bower version..."
RELEASE_VERSION=$(cat package.json | grep "version" | head -1 | gsed -e 's/ "version": "\(.*\)",/\1/')
if [[ "$OSTYPE" == "linux-gnu" ]]; then
SED_BIN=sed
elif [[ "$OSTYPE" == "darwin"* ]]; then
SED_BIN=gsed
else
echo "Cannot run this script in ${OSTYPE}"
exit 1
fi
gsed -i 's/.*"version".*/ "version": "'${RELEASE_VERSION}'",/' bower.json
RELEASE_VERSION=$(cat package.json | grep "version" | head -1 | $SED_BIN -e 's/ "version": "\(.*\)",/\1/')
$SED_BIN -i 's/.*"version".*/ "version": "'${RELEASE_VERSION}'",/' bower.json
echo "diff2html updated bower version successfully!"