Skip to content

Commit 0a30c46

Browse files
tboschjamesdaily
authored andcommitted
chore(build): correct updating bower versions
1 parent 62cb5bb commit 0a30c46

File tree

2 files changed

+7
-18
lines changed

2 files changed

+7
-18
lines changed

scripts/bower/README.md

-3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22

33
Script for updating the Angular bower repos from current local build.
44

5-
Requires `node` (for parsing `bower.json`)
6-
7-
85
## Instructions
96

107
`grunt package`: Build angular locally

scripts/bower/publish.sh

+7-15
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,8 @@ set -xe
1010
cd `dirname $0`
1111

1212
SCRIPT_DIR=`pwd`
13-
14-
# export so that node.js can read those env settings
15-
export TMP_DIR=../../tmp
16-
export BUILD_DIR=../../build
17-
13+
TMP_DIR=../../tmp
14+
BUILD_DIR=../../build
1815
NEW_VERSION=`cat $BUILD_DIR/version.txt`
1916

2017
REPOS=(
@@ -67,24 +64,19 @@ cp $BUILD_DIR/i18n/*.js $TMP_DIR/bower-angular-i18n/
6764
cp $BUILD_DIR/angular-csp.css $TMP_DIR/bower-angular
6865

6966

70-
#
71-
# get the old version number
72-
#
73-
74-
OLD_VERSION=$(node -e "console.log(require(process.env.TMP_DIR+'/bower-angular/bower').version)" | sed -e 's/\r//g')
75-
echo $OLD_VERSION
76-
echo $NEW_VERSION
77-
7867
#
7968
# update bower.json
8069
# tag each repo
8170
#
8271

8372
for repo in "${REPOS[@]}"
8473
do
85-
echo "-- Updating version in bower-$repo from $OLD_VERSION to $NEW_VERSION"
74+
echo "-- Updating version in bower-$repo to $NEW_VERSION"
8675
cd $TMP_DIR/bower-$repo
87-
sed -i '' -e "s/$OLD_VERSION/$NEW_VERSION/g" bower.json
76+
sed -i .tmp -E 's/"(version)":[ ]*".*"/"\1": "'$NEW_VERSION'"/g' bower.json
77+
sed -i .tmp -E 's/"(angular.*)":[ ]*".*"/"\1": "'$NEW_VERSION'"/g' bower.json
78+
# delete tmp files
79+
rm *.tmp
8880
git add -A
8981

9082
echo "-- Committing, tagging and pushing bower-$repo"

0 commit comments

Comments
 (0)