diff options
| author | Peter Bacon Darwin | 2014-03-14 14:35:58 +0000 |
|---|---|---|
| committer | Tobias Bosch | 2014-03-20 14:33:14 -0700 |
| commit | de07ddeac6b7cd39ffbfb8da310a7fea71861623 (patch) | |
| tree | 89df30610aedbcb5d156249109f876bf7cd52f24 /scripts/angularjs.org | |
| parent | dc149de9364c66b988f169f67cad39577ba43434 (diff) | |
| download | angular.js-de07ddeac6b7cd39ffbfb8da310a7fea71861623.tar.bz2 | |
chore(angularjs.org/publish.sh): align release script with new website
Closes #6690
Diffstat (limited to 'scripts/angularjs.org')
| -rwxr-xr-x | scripts/angularjs.org/publish.sh | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/scripts/angularjs.org/publish.sh b/scripts/angularjs.org/publish.sh index 1efb621b..3d78dc01 100755 --- a/scripts/angularjs.org/publish.sh +++ b/scripts/angularjs.org/publish.sh @@ -11,8 +11,12 @@ ARG_DEFS=( ) function init { - TMP_DIR=$(resolveDir ../../tmp) + BASE_DIR=$(resolveDir ../..) + TMP_DIR=$BASE_DIR/tmp REPO_DIR=$TMP_DIR/angularjs.org + BRANCH_PATTERN=$(readJsonProp "$BASE_DIR/package.json" "branchVersion") + BUILD_DIR=$BASE_DIR/build + NEW_VERSION=$(cat $BUILD_DIR/version.txt) } function prepare { @@ -24,18 +28,24 @@ function prepare { # echo "-- Updating angularjs.org" cd $REPO_DIR - VERSION_REGEX="[a-z0-9\-\.\+]+" + VERSION_REGEX="[-a-z0-9\.\+]+" - replaceInFile "index.html" "(ajax\/libs\/angularjs\/)$VERSION_REGEX" "\1$CDN_VERSION" - replaceInFile "index.html" "(<span class=\"version\">[^<]*<span>)$VERSION_REGEX" "\1$CDN_VERSION" - replaceInFile "index.html" "(code.angularjs.org\/)$VERSION_REGEX" "\1$CDN_VERSION" + # Replace the version in the script links that reference the Google CDN + # e.g. <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.3.0-beta.1/angular.js"></script> + replaceInFile "index.html" "(http:\/\/ajax.googleapis.com\/ajax\/libs\/angularjs\/)$VERSION_REGEX" "\1$CDN_VERSION" - replaceInFile "js/homepage.js" "($scope.CURRENT_STABLE_VERSION[ ]*=[ ]*')$VERSION_REGEX" "\1$CDN_VERSION" - replaceInFile "js/homepage.js" "($scope.CURRENT_UNSTABLE_VERSION[ ]*=[ ]*')$VERSION_REGEX" "\1$CDN_VERSION" + # Replace the version in the script links that reference code.angularjs.org + # e.g. <script src="http://code.angularjs.org/1.3.0-beta.1/i18n/angular-locale_sk.js"></script> + replaceInFile "index.html" "(code\.angularjs\.org\/)$VERSION_REGEX" "\1$CDN_VERSION" + # Replace the version of the branch that we are updating + echo $BRANCH_PATTERN + echo $NEW_VERSION + replaceInFile "js/download-data.js" "branch:[ ]+'($BRANCH_PATTERN)',[ ]+version:[ ]+'$VERSION_REGEX'" "branch: '\1', version: '$NEW_VERSION'" + git add index.html - git add js/homepage.js - git commit -m "update(version): update angular version to $CDN_VERSION" + git add js/download-data.js + git commit -m "update(version): update angular version to $NEW_VERSION for branch $BRANCH_PATTERN" } function publish { |
