aboutsummaryrefslogtreecommitdiff
path: root/scripts/vim-patch.sh
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/vim-patch.sh')
-rwxr-xr-xscripts/vim-patch.sh14
1 files changed, 11 insertions, 3 deletions
diff --git a/scripts/vim-patch.sh b/scripts/vim-patch.sh
index ecaddeacf6..a8b622d5c4 100755
--- a/scripts/vim-patch.sh
+++ b/scripts/vim-patch.sh
@@ -5,6 +5,12 @@ set -u
# Use privileged mode, which e.g. skips using CDPATH.
set -p
+# Ensure that the user has a bash that supports -A
+if [[ "${BASH_VERSINFO[0]}" -lt 4 ]]; then
+ echo "This script requires bash version 3 or later (you have ${BASH_VERSION})." >&2
+ exit 1
+fi
+
readonly NVIM_SOURCE_DIR="${NVIM_SOURCE_DIR:-$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)}"
readonly VIM_SOURCE_DIR_DEFAULT="${NVIM_SOURCE_DIR}/.vim-src"
readonly VIM_SOURCE_DIR="${VIM_SOURCE_DIR:-${VIM_SOURCE_DIR_DEFAULT}}"
@@ -674,9 +680,11 @@ review_pr() {
echo
echo "Downloading data for pull request #${pr}."
- local pr_commit_urls=(
- "$(curl -Ssf "https://api.github.com/repos/neovim/neovim/pulls/${pr}/commits" \
- | jq -r '.[].html_url')")
+ local -a pr_commit_urls
+ while IFS= read -r pr_commit_url; do
+ pr_commit_urls+=("$pr_commit_url")
+ done < <(curl -Ssf "https://api.github.com/repos/neovim/neovim/pulls/${pr}/commits" \
+ | jq -r '.[].html_url')
echo "Found ${#pr_commit_urls[@]} commit(s)."