File tree Expand file tree Collapse file tree 1 file changed +11
-9
lines changed Expand file tree Collapse file tree 1 file changed +11
-9
lines changed Original file line number Diff line number Diff line change @@ -4,15 +4,9 @@ ARG_DEFS=(
44 # require the git dryrun flag so the script can't be run without
55 # thinking about this!
66 " --git-push-dryrun=(true|false)"
7+ " --cdn-version=(.*)"
78)
89
9- function findLatestRelease {
10- # returns e.g. v1.2.7
11- LATEST_TAG=$( git describe --abbrev=0 --tags)
12- # returns e.g. 1.2.7
13- echo ${LATEST_TAG: 1}
14- }
15-
1610function init {
1711 NG_ARGS=(" $@ " )
1812 if [[ ! $VERBOSE ]]; then
@@ -23,14 +17,22 @@ function init {
2317
2418function phase {
2519 ACTION_ARG=" --action=$1 "
26- CDN_VERSION_ARG=" --cdn-version=$LATEST_VERSION "
20+ CDN_VERSION_ARG=" --cdn-version=$CDN_VERSION "
2721 ./scripts/angular.js/publish-cdn-version.sh $ACTION_ARG $CDN_VERSION_ARG $VERBOSE_ARG
2822 ./scripts/angularjs.org/publish.sh $ACTION_ARG $CDN_VERSION_ARG $VERBOSE_ARG
2923}
3024
25+ function checkCdn {
26+ STATUS=$( curl http://ajax.googleapis.com/ajax/libs/angularjs/$CDN_VERSION /angular.min.js --write-out ' %{http_code}' -o /dev/null -silent)
27+ if [[ $STATUS != 200 ]]; then
28+ echo " Could not find release $CDN_VERSION on CDN"
29+ exit 1
30+ fi
31+ }
32+
3133function run {
3234 cd ../..
33- LATEST_VERSION= $( findLatestRelease )
35+ checkCdn
3436
3537 phase prepare
3638 phase publish
You can’t perform that action at this time.
0 commit comments