Skip to content
This repository has been archived by the owner on May 18, 2021. It is now read-only.

feat: support --distribution-repository <git_repository_url> #32

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion bin/update-branch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 <git_repository_url>

Specifies the git repository url to push

-m, --commit-message <message>

Expand Down Expand Up @@ -119,6 +122,7 @@ main() {
local commitMessage=""
local directory=""
local distributionBranch=""
local distributionRepository=""
local sourceBranch=""

# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Expand Down Expand Up @@ -164,6 +168,17 @@ main() {
fi
;;

--distribution-repository)
if [ "$2" ]; then
distributionRepository="$2"
shift 2
continue
else
echo "ERROR: A non-empty \"--distributionRepository <git_repository_url>\" argument needs to be specified" >&2
exit 1
fi
;;

-m|--commit-message)
if [ "$2" ]; then
commitMessage="$2"
Expand Down Expand Up @@ -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) \
Expand Down