浏览代码

Jumping back to the previous branch after publishing the component

Jose Lorenzo Rodriguez 11 年之前
父节点
当前提交
5b84eed35d
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      Makefile

+ 3 - 1
Makefile

@@ -7,6 +7,7 @@
 # is a pre-release
 # is a pre-release
 PRERELEASE=$(shell echo $(VERSION) | grep -E 'dev|rc|alpha|beta' --quiet && echo 'true' || echo 'false')
 PRERELEASE=$(shell echo $(VERSION) | grep -E 'dev|rc|alpha|beta' --quiet && echo 'true' || echo 'false')
 COMPONENTS= log utility cache datasource core collection event validation
 COMPONENTS= log utility cache datasource core collection event validation
+CURRENT_BRANCH=$(shell git branch | grep '*' | tr -d '* ')
 
 
 # Github settings
 # Github settings
 UPLOAD_HOST=https://uploads.github.com
 UPLOAD_HOST=https://uploads.github.com
@@ -158,12 +159,13 @@ publish: guard-VERSION guard-GITHUB_USER dist/cakephp-$(DASH_VERSION).zip
 components: $(foreach component, $(COMPONENTS), component-$(component))
 components: $(foreach component, $(COMPONENTS), component-$(component))
 
 
 component-%:
 component-%:
-	git checkout 3.0 > /dev/null
+	git checkout $(CURRENT_BRANCH) > /dev/null
 	- (git remote add $* git@github.com:cakephp/$*.git -f 2> /dev/null)
 	- (git remote add $* git@github.com:cakephp/$*.git -f 2> /dev/null)
 	- (git branch -D $* 2> /dev/null)
 	- (git branch -D $* 2> /dev/null)
 	git checkout -b $*
 	git checkout -b $*
 	git filter-branch --prune-empty --subdirectory-filter src/$(shell php -r "echo ucfirst('$*');") -f $*
 	git filter-branch --prune-empty --subdirectory-filter src/$(shell php -r "echo ucfirst('$*');") -f $*
 	git push $* $*:master
 	git push $* $*:master
+	git checkout $(CURRENT_BRANCH) > /dev/null
 
 
 # Top level alias for doing a release.
 # Top level alias for doing a release.
 release: guard-VERSION guard-GITHUB_USER tag-release package publish
 release: guard-VERSION guard-GITHUB_USER tag-release package publish