Improve script for Ubuntu
This commit is contained in:
parent
7c79cc32db
commit
f500bb09ea
1 changed files with 11 additions and 2 deletions
|
|
@ -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!"
|
||||
|
|
|
|||
Loading…
Reference in a new issue