chore(build): correct updating bower versions

This commit is contained in:
Tobias Bosch 2013-12-16 09:47:23 -08:00
parent b0474cb984
commit 6144df52af
2 changed files with 7 additions and 18 deletions

View file

@ -2,9 +2,6 @@
Script for updating the Angular bower repos from current local build.
Requires `node` (for parsing `bower.json`)
## Instructions
`grunt package`: Build angular locally

View file

@ -10,11 +10,8 @@ set -xe
cd `dirname $0`
SCRIPT_DIR=`pwd`
# export so that node.js can read those env settings
export TMP_DIR=../../tmp
export BUILD_DIR=../../build
TMP_DIR=../../tmp
BUILD_DIR=../../build
NEW_VERSION=`cat $BUILD_DIR/version.txt`
REPOS=(
@ -67,14 +64,6 @@ cp $BUILD_DIR/i18n/*.js $TMP_DIR/bower-angular-i18n/
cp $BUILD_DIR/angular-csp.css $TMP_DIR/bower-angular
#
# get the old version number
#
OLD_VERSION=$(node -e "console.log(require(process.env.TMP_DIR+'/bower-angular/bower').version)" | sed -e 's/\r//g')
echo $OLD_VERSION
echo $NEW_VERSION
#
# update bower.json
# tag each repo
@ -82,9 +71,12 @@ echo $NEW_VERSION
for repo in "${REPOS[@]}"
do
echo "-- Updating version in bower-$repo from $OLD_VERSION to $NEW_VERSION"
echo "-- Updating version in bower-$repo to $NEW_VERSION"
cd $TMP_DIR/bower-$repo
sed -i '' -e "s/$OLD_VERSION/$NEW_VERSION/g" bower.json
sed -i .tmp -E 's/"(version)":[ ]*".*"/"\1": "'$NEW_VERSION'"/g' bower.json
sed -i .tmp -E 's/"(angular.*)":[ ]*".*"/"\1": "'$NEW_VERSION'"/g' bower.json
# delete tmp files
rm *.tmp
git add -A
echo "-- Committing, tagging and pushing bower-$repo"