From 1603d839f9f1e55304b7fd0891730d495ccfb3cf Mon Sep 17 00:00:00 2001 From: azu Date: Fri, 18 May 2018 20:36:08 +0900 Subject: [PATCH] feat: support `--distribution-repository ` it allow to push to other repository --- bin/update-branch.sh | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/bin/update-branch.sh b/bin/update-branch.sh index 25a7f02..c4181fd 100755 --- a/bin/update-branch.sh +++ b/bin/update-branch.sh @@ -63,6 +63,9 @@ OPTIONS: Specifies the name of the branch on which the content resulting from running the commands will be moved on. + --distribution-repository + + Specifies the git repository url to push -m, --commit-message @@ -119,6 +122,7 @@ main() { local commitMessage="" local directory="" local distributionBranch="" + local distributionRepository="" local sourceBranch="" # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -164,6 +168,17 @@ main() { fi ;; + --distribution-repository) + if [ "$2" ]; then + distributionRepository="$2" + shift 2 + continue + else + echo "ERROR: A non-empty \"--distributionRepository \" argument needs to be specified" >&2 + exit 1 + fi + ;; + -m|--commit-message) if [ "$2" ]; then commitMessage="$2" @@ -213,7 +228,11 @@ main() { if [ "$TRAVIS_BRANCH" == "$sourceBranch" ] && \ [ "$TRAVIS_PULL_REQUEST" == "false" ]; then - repository_url="$(get_repository_url)" + if [ "$distributionRepository" != "" ]; then + repository_url="$distributionRepository" + else + repository_url="$(get_repository_url)" + fi execute "$commands" \ &> >(print_error_stream) \