aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames McCoy <jamessan@jamessan.com>2016-05-16 23:41:41 -0400
committerJames McCoy <jamessan@jamessan.com>2016-05-19 06:40:37 -0400
commitaf3d4b40492e6eb9f3ab44d819addceb29b01fe0 (patch)
tree218094dff7f5531cc0326d40aa31124a161745dc
parent9c7038c4757351bbeb1e9e6615ec833d3c7dfb4e (diff)
downloadrneovim-af3d4b40492e6eb9f3ab44d819addceb29b01fe0.tar.gz
rneovim-af3d4b40492e6eb9f3ab44d819addceb29b01fe0.tar.bz2
rneovim-af3d4b40492e6eb9f3ab44d819addceb29b01fe0.zip
vim-patch.sh: Rename check_executable to require_executable
check_executable now just wraps the "exists && executable" check. This will be needed to allow fallbacks for commands.
-rwxr-xr-xscripts/vim-patch.sh18
1 files changed, 11 insertions, 7 deletions
diff --git a/scripts/vim-patch.sh b/scripts/vim-patch.sh
index 751f50d290..2d9f61ff36 100755
--- a/scripts/vim-patch.sh
+++ b/scripts/vim-patch.sh
@@ -33,7 +33,11 @@ usage() {
# Checks if a program is in the user's PATH, and is executable.
check_executable() {
- if [[ ! -x $(command -v "${1}") ]]; then
+ test -x "$(command -v "${1}")"
+}
+
+require_executable() {
+ if ! check_executable "${1}"; then
>&2 echo "${BASENAME}: '${1}' not found in PATH or not executable."
exit 1
fi
@@ -61,7 +65,7 @@ clean_files() {
}
get_vim_sources() {
- check_executable git
+ require_executable git
if [[ ! -d ${VIM_SOURCE_DIR} ]]; then
echo "Cloning Vim sources into '${VIM_SOURCE_DIR}'."
@@ -195,8 +199,8 @@ get_vim_patch() {
}
submit_pr() {
- check_executable git
- check_executable hub
+ require_executable git
+ require_executable hub
cd "${NEOVIM_SOURCE_DIR}"
local checked_out_branch
@@ -346,9 +350,9 @@ review_commit() {
}
review_pr() {
- check_executable curl
- check_executable nvim
- check_executable jq
+ require_executable curl
+ require_executable nvim
+ require_executable jq
get_vim_sources