patch 8.1.2253: using "which" to check for an executable is not reliable

Problem:    Using "which" to check for an executable is not reliable.
Solution:   Use "command -v" instead.  Also exit with error code when
            generating tags has an error. (closes #5174)
This commit is contained in:
Bram Moolenaar
2019-11-04 21:24:48 +01:00
parent 2ade714728
commit ad4de52510
2 changed files with 5 additions and 3 deletions

View File

@ -323,9 +323,9 @@ all: tags vim.man evim.man vimdiff.man vimtutor.man xxd.man $(CONVERTED)
# Use Vim to generate the tags file. Can only be used when Vim has been
# compiled and installed. Supports multiple languages.
vimtags: $(DOCS)
@if which $(VIMEXE) >/dev/null; then \
$(VIMEXE) --clean -eX -u doctags.vim >/dev/null; \
echo "help tags updated"; \
@if command -v $(VIMEXE); then \
$(VIMEXE) --clean -eX -u doctags.vim >/dev/null && \
echo "help tags updated"; \
else echo "vim executable $(VIMEXE) not found; help tags not updated"; fi
# Use "doctags" to generate the tags file. Only works for English!

View File

@ -741,6 +741,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
2253,
/**/
2252,
/**/