mirror of
https://github.com/neovim/neovim.git
synced 2024-12-24 13:15:09 -07:00
chore(vim-patch.sh): replace hub with gh (#15162)
This commit is contained in:
parent
8baf7bce2b
commit
545e05d2fe
@ -326,12 +326,14 @@ stage_patch() {
|
|||||||
return $ret
|
return $ret
|
||||||
}
|
}
|
||||||
|
|
||||||
hub_pr() {
|
gh_pr() {
|
||||||
hub pull-request -m "$1"
|
gh pr create --title "$1" --body "$2"
|
||||||
}
|
}
|
||||||
|
|
||||||
git_hub_pr() {
|
git_hub_pr() {
|
||||||
git hub pull new -m "$1"
|
local pr_message
|
||||||
|
pr_message="$(printf '%s\n\n%s\n' "$1" "$2")"
|
||||||
|
git hub pull new -m "${pr_message}"
|
||||||
}
|
}
|
||||||
|
|
||||||
# shellcheck disable=SC2015
|
# shellcheck disable=SC2015
|
||||||
@ -341,14 +343,14 @@ submit_pr() {
|
|||||||
local push_first
|
local push_first
|
||||||
push_first=1
|
push_first=1
|
||||||
local submit_fn
|
local submit_fn
|
||||||
if check_executable hub; then
|
if check_executable gh; then
|
||||||
submit_fn="hub_pr"
|
submit_fn="gh_pr"
|
||||||
elif check_executable git-hub; then
|
elif check_executable git-hub; then
|
||||||
push_first=0
|
push_first=0
|
||||||
submit_fn="git_hub_pr"
|
submit_fn="git_hub_pr"
|
||||||
else
|
else
|
||||||
>&2 echo "${BASENAME}: 'hub' or 'git-hub' not found in PATH or not executable."
|
>&2 echo "${BASENAME}: 'gh' or 'git-hub' not found in PATH or not executable."
|
||||||
>&2 echo " Get it here: https://hub.github.com/"
|
>&2 echo " Get it here: https://cli.github.com/"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -371,9 +373,7 @@ submit_pr() {
|
|||||||
patches=(${patches[@]//vim-patch:}) # Remove 'vim-patch:' prefix for each item in array.
|
patches=(${patches[@]//vim-patch:}) # Remove 'vim-patch:' prefix for each item in array.
|
||||||
local pr_title="${patches[*]}" # Create space-separated string from array.
|
local pr_title="${patches[*]}" # Create space-separated string from array.
|
||||||
pr_title="${pr_title// /,}" # Replace spaces with commas.
|
pr_title="${pr_title// /,}" # Replace spaces with commas.
|
||||||
|
pr_title="$(printf 'vim-patch:%s' "${pr_title#,}")"
|
||||||
local pr_message
|
|
||||||
pr_message="$(printf 'vim-patch:%s\n\n%s\n' "${pr_title#,}" "${pr_body}")"
|
|
||||||
|
|
||||||
if [[ $push_first -ne 0 ]]; then
|
if [[ $push_first -ne 0 ]]; then
|
||||||
echo "Pushing to 'origin/${checked_out_branch}'."
|
echo "Pushing to 'origin/${checked_out_branch}'."
|
||||||
@ -385,7 +385,7 @@ submit_pr() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Creating pull request."
|
echo "Creating pull request."
|
||||||
output="$(${submit_fn} "${pr_message}" 2>&1)" &&
|
output="$(${submit_fn} "${pr_title}" "${pr_body}" 2>&1)" &&
|
||||||
msg_ok "${output}" ||
|
msg_ok "${output}" ||
|
||||||
(msg_err "${output}"; false)
|
(msg_err "${output}"; false)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user