mirror of
https://github.com/neovim/neovim.git
synced 2025-12-05 14:13:10 +00:00
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.
This commit is contained in:
@@ -33,7 +33,11 @@ usage() {
|
|||||||
|
|
||||||
# Checks if a program is in the user's PATH, and is executable.
|
# Checks if a program is in the user's PATH, and is executable.
|
||||||
check_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."
|
>&2 echo "${BASENAME}: '${1}' not found in PATH or not executable."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
@@ -61,7 +65,7 @@ clean_files() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
get_vim_sources() {
|
get_vim_sources() {
|
||||||
check_executable git
|
require_executable git
|
||||||
|
|
||||||
if [[ ! -d ${VIM_SOURCE_DIR} ]]; then
|
if [[ ! -d ${VIM_SOURCE_DIR} ]]; then
|
||||||
echo "Cloning Vim sources into '${VIM_SOURCE_DIR}'."
|
echo "Cloning Vim sources into '${VIM_SOURCE_DIR}'."
|
||||||
@@ -195,8 +199,8 @@ get_vim_patch() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
submit_pr() {
|
submit_pr() {
|
||||||
check_executable git
|
require_executable git
|
||||||
check_executable hub
|
require_executable hub
|
||||||
|
|
||||||
cd "${NEOVIM_SOURCE_DIR}"
|
cd "${NEOVIM_SOURCE_DIR}"
|
||||||
local checked_out_branch
|
local checked_out_branch
|
||||||
@@ -346,9 +350,9 @@ review_commit() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
review_pr() {
|
review_pr() {
|
||||||
check_executable curl
|
require_executable curl
|
||||||
check_executable nvim
|
require_executable nvim
|
||||||
check_executable jq
|
require_executable jq
|
||||||
|
|
||||||
get_vim_sources
|
get_vim_sources
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user