From 4e048162e08b62d655b2995d155e040912b2a461 Mon Sep 17 00:00:00 2001 From: Matt Keeler Date: Wed, 20 Jun 2018 16:35:54 -0400 Subject: [PATCH] Add override capability to blacklist a remote --- build-support/functions/10-util.sh | 11 +++++++++++ build-support/functions/40-publish.sh | 5 ++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/build-support/functions/10-util.sh b/build-support/functions/10-util.sh index e997ccd2c4..2e89cbd155 100644 --- a/build-support/functions/10-util.sh +++ b/build-support/functions/10-util.sh @@ -441,6 +441,17 @@ function find_git_remote { return ${ret} } +function git_remote_not_blacklisted { + # Arguments: + # $1 - path to the repo + # $2 - the remote name + # + # Returns: + # 0 - not blacklisted + # * - blacklisted + return 0 +} + function is_git_clean { # Arguments: # $1 - Path to git repo diff --git a/build-support/functions/40-publish.sh b/build-support/functions/40-publish.sh index 3376ef168a..ffb8e64bf9 100644 --- a/build-support/functions/40-publish.sh +++ b/build-support/functions/40-publish.sh @@ -320,8 +320,11 @@ function publish_release { status_stage "==> Confirming Git Changes" confirm_git_push_changes "$1" || return 1 - status_stage "==> Confirming Git Remote" + status_stage "==> Checking for blacklisted Git Remote" local remote=$(find_git_remote "${sdir}") || return 1 + git_remote_not_blacklisted "${sdir}" "${remote}" || return 1 + + status_stage "==> Confirming Git Remote" confirm_git_remote "${sdir}" "${remote}" || return 1 if is_set "${pub_git}"