aboutsummaryrefslogtreecommitdiff
path: root/scripts/vim-patch.sh
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2021-08-04 01:52:48 +0800
committerGitHub <noreply@github.com>2021-08-03 19:52:48 +0200
commit545e05d2fe98683494eb972e2661e348f2c0c290 (patch)
tree0869a4b44f7c38d1ec39a1137070bde1a4ec79e5 /scripts/vim-patch.sh
parent8baf7bce2b51e8d3d47b6c70ce054663d927639a (diff)
downloadrneovim-545e05d2fe98683494eb972e2661e348f2c0c290.tar.gz
rneovim-545e05d2fe98683494eb972e2661e348f2c0c290.tar.bz2
rneovim-545e05d2fe98683494eb972e2661e348f2c0c290.zip
chore(vim-patch.sh): replace hub with gh (#15162)
Diffstat (limited to 'scripts/vim-patch.sh')
-rwxr-xr-xscripts/vim-patch.sh22
1 files changed, 11 insertions, 11 deletions
diff --git a/scripts/vim-patch.sh b/scripts/vim-patch.sh
index 4fd9711619..e9242c4dbe 100755
--- a/scripts/vim-patch.sh
+++ b/scripts/vim-patch.sh
@@ -326,12 +326,14 @@ stage_patch() {
return $ret
}
-hub_pr() {
- hub pull-request -m "$1"
+gh_pr() {
+ gh pr create --title "$1" --body "$2"
}
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
@@ -341,14 +343,14 @@ submit_pr() {
local push_first
push_first=1
local submit_fn
- if check_executable hub; then
- submit_fn="hub_pr"
+ if check_executable gh; then
+ submit_fn="gh_pr"
elif check_executable git-hub; then
push_first=0
submit_fn="git_hub_pr"
else
- >&2 echo "${BASENAME}: 'hub' or 'git-hub' not found in PATH or not executable."
- >&2 echo " Get it here: https://hub.github.com/"
+ >&2 echo "${BASENAME}: 'gh' or 'git-hub' not found in PATH or not executable."
+ >&2 echo " Get it here: https://cli.github.com/"
exit 1
fi
@@ -371,9 +373,7 @@ submit_pr() {
patches=(${patches[@]//vim-patch:}) # Remove 'vim-patch:' prefix for each item in array.
local pr_title="${patches[*]}" # Create space-separated string from array.
pr_title="${pr_title// /,}" # Replace spaces with commas.
-
- local pr_message
- pr_message="$(printf 'vim-patch:%s\n\n%s\n' "${pr_title#,}" "${pr_body}")"
+ pr_title="$(printf 'vim-patch:%s' "${pr_title#,}")"
if [[ $push_first -ne 0 ]]; then
echo "Pushing to 'origin/${checked_out_branch}'."
@@ -385,7 +385,7 @@ submit_pr() {
fi
echo "Creating pull request."
- output="$(${submit_fn} "${pr_message}" 2>&1)" &&
+ output="$(${submit_fn} "${pr_title}" "${pr_body}" 2>&1)" &&
msg_ok "${output}" ||
(msg_err "${output}"; false)