Mercurial > vim
changeset 18518:59c56c97049d v8.1.2253
patch 8.1.2253: using "which" to check for an executable is not reliable
Commit: https://github.com/vim/vim/commit/ad4de52510d5b4a949c0c9e25b5d5333744820b3
Author: Bram Moolenaar <Bram@vim.org>
Date: Mon Nov 4 21:24:48 2019 +0100
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)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Mon, 04 Nov 2019 21:30:03 +0100 |
parents | 7ca13352c0dd |
children | 66bcf00b61df |
files | runtime/doc/Makefile src/version.c |
diffstat | 2 files changed, 5 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/runtime/doc/Makefile +++ b/runtime/doc/Makefile @@ -323,9 +323,9 @@ all: tags vim.man evim.man vimdiff.man v # 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!