mirror of https://github.com/k3s-io/k3s
Merge pull request #76856 from SataQiu/fix-hack-cherrypick-20190420
Fix shellcheck failures of hack/cherry_pick_pull.shk3s-v1.15.3
commit
75d45bdfc9
|
@ -21,7 +21,6 @@
|
|||
./cluster/restore-from-backup.sh
|
||||
./cluster/test-e2e.sh
|
||||
./cluster/validate-cluster.sh
|
||||
./hack/cherry_pick_pull.sh
|
||||
./hack/ginkgo-e2e.sh
|
||||
./hack/grab-profiles.sh
|
||||
./hack/lib/init.sh
|
||||
|
|
|
@ -84,8 +84,10 @@ shift 1
|
|||
declare -r PULLS=( "$@" )
|
||||
|
||||
function join { local IFS="$1"; shift; echo "$*"; }
|
||||
declare -r PULLDASH=$(join - "${PULLS[@]/#/#}") # Generates something like "#12345-#56789"
|
||||
declare -r PULLSUBJ=$(join " " "${PULLS[@]/#/#}") # Generates something like "#12345 #56789"
|
||||
PULLDASH=$(join - "${PULLS[@]/#/#}") # Generates something like "#12345-#56789"
|
||||
declare -r PULLDASH
|
||||
PULLSUBJ=$(join " " "${PULLS[@]/#/#}") # Generates something like "#12345 #56789"
|
||||
declare -r PULLSUBJ
|
||||
|
||||
echo "+++ Updating remotes..."
|
||||
git remote update "${UPSTREAM_REMOTE}" "${FORK_REMOTE}"
|
||||
|
@ -96,9 +98,12 @@ if ! git log -n1 --format=%H "${BRANCH}" >/dev/null 2>&1; then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
declare -r NEWBRANCHREQ="automated-cherry-pick-of-${PULLDASH}" # "Required" portion for tools.
|
||||
declare -r NEWBRANCH="$(echo "${NEWBRANCHREQ}-${BRANCH}" | sed 's/\//-/g')"
|
||||
declare -r NEWBRANCHUNIQ="${NEWBRANCH}-$(date +%s)"
|
||||
NEWBRANCHREQ="automated-cherry-pick-of-${PULLDASH}" # "Required" portion for tools.
|
||||
declare -r NEWBRANCHREQ
|
||||
NEWBRANCH="$(echo "${NEWBRANCHREQ}-${BRANCH}" | sed 's/\//-/g')"
|
||||
declare -r NEWBRANCH
|
||||
NEWBRANCHUNIQ="${NEWBRANCH}-$(date +%s)"
|
||||
declare -r NEWBRANCHUNIQ
|
||||
echo "+++ Creating local branch ${NEWBRANCHUNIQ}"
|
||||
|
||||
cleanbranch=""
|
||||
|
@ -128,7 +133,8 @@ trap return_to_kansas EXIT
|
|||
|
||||
SUBJECTS=()
|
||||
function make-a-pr() {
|
||||
local rel="$(basename "${BRANCH}")"
|
||||
local rel
|
||||
rel="$(basename "${BRANCH}")"
|
||||
echo
|
||||
echo "+++ Creating a pull request on GitHub at ${GITHUB_USER}:${NEWBRANCH}"
|
||||
|
||||
|
@ -137,7 +143,8 @@ function make-a-pr() {
|
|||
# when we shove the heredoc at hub directly, tickling the ioctl
|
||||
# crash.
|
||||
prtext="$(mktemp -t prtext.XXXX)" # cleaned in return_to_kansas
|
||||
local numandtitle=$(printf '%s\n' "${SUBJECTS[@]}")
|
||||
local numandtitle
|
||||
numandtitle=$(printf '%s\n' "${SUBJECTS[@]}")
|
||||
cat >"${prtext}" <<EOF
|
||||
Automated cherry pick of ${numandtitle}
|
||||
|
||||
|
@ -218,7 +225,7 @@ if [[ -n "${DRY_RUN}" ]]; then
|
|||
exit 0
|
||||
fi
|
||||
|
||||
if git remote -v | grep ^${FORK_REMOTE} | grep ${MAIN_REPO_ORG}/${MAIN_REPO_NAME}.git; then
|
||||
if git remote -v | grep ^"${FORK_REMOTE}" | grep "${MAIN_REPO_ORG}/${MAIN_REPO_NAME}.git"; then
|
||||
echo "!!! You have ${FORK_REMOTE} configured as your ${MAIN_REPO_ORG}/${MAIN_REPO_NAME}.git"
|
||||
echo "This isn't normal. Leaving you with push instructions:"
|
||||
echo
|
||||
|
|
Loading…
Reference in New Issue