diff2html/scripts/update-bower-version.sh

26 lines
532 B
Bash
Raw Normal View History

#!/bin/bash
#
# diff2html update bower version
# by rtfpessoa
#
set -e
echo "diff2html updating bower version..."
2016-06-27 20:20:51 +00:00
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
2016-06-27 20:20:51 +00:00
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!"