mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
chore(build): fix update-angular script
This commit is contained in:
@@ -48,9 +48,9 @@
|
||||
"js/ionic.js"
|
||||
],
|
||||
"dependencies": {
|
||||
"angular": "^1.2.12",
|
||||
"angular-animate": "^1.2.12",
|
||||
"angular-sanitize": "^1.2.12",
|
||||
"angular": "~1.2.12",
|
||||
"angular-animate": "~1.2.12",
|
||||
"angular-sanitize": "~1.2.12",
|
||||
"angular-ui-router": "0.2.7"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,16 +4,23 @@ ARG_DEFS=(
|
||||
"--version=(.*)"
|
||||
)
|
||||
function run {
|
||||
PROJECT_DIR=$SCRIPT_DIR/../
|
||||
|
||||
cd $SCRIPT_DIR/..//config/lib/js/angular/
|
||||
cd $SCRIPT_DIR/../config/lib/js/angular/
|
||||
rm -rf *.js
|
||||
wget http://code.angularjs.org/$VERSION/angular{,-animate,-mocks,-resource,-scenario,-animate.min,-resource.min,.min,-sanitize,-sanitize.min}.js
|
||||
|
||||
cd $SCRIPT_DIR/../
|
||||
wget http://code.angularjs.org/$VERSION/angular{,-sanitize,-animate,-resource}{.min.js,.js}
|
||||
|
||||
replaceJsonProp "bower.json" "angular" $VERSION
|
||||
replaceJsonProp "bower.json" "angular-animate" $VERSION
|
||||
replaceJsonProp "bower.json" "angular-sanitize" $VERSION
|
||||
# # no min versions of mocks and scenario
|
||||
wget http://code.angularjs.org/$VERSION/angular{-scenario,-mocks}.js
|
||||
|
||||
cd $PROJECT_DIR
|
||||
|
||||
echo "Setting bower.json angular versions to ~$VERSION"
|
||||
|
||||
replaceJsonProp "bower.json" "angular" "~$VERSION"
|
||||
replaceJsonProp "bower.json" "angular-animate" "~$VERSION"
|
||||
replaceJsonProp "bower.json" "angular-sanitize" "~$VERSION"
|
||||
}
|
||||
|
||||
source $(dirname $0)/utils.inc
|
||||
|
||||
@@ -206,8 +206,7 @@ function readJsonProp {
|
||||
# - note: propertyRegex will be automatically placed into a
|
||||
# capturing group! -> all other groups start at index 2!
|
||||
function replaceJsonProp {
|
||||
local VALUE=$(readJsonProp $1 $2)
|
||||
replaceInFile $1 $VALUE $3
|
||||
replaceInFile $1 "\"$2\": \".*?\"" "\"$2\": \"$3\""
|
||||
}
|
||||
|
||||
# replaceInFile(file, findPattern, replacePattern)
|
||||
|
||||
Reference in New Issue
Block a user