From 472925ac92b333e798eb940584c7e47b9d06804d Mon Sep 17 00:00:00 2001 From: skywind3000 Date: Mon, 25 Feb 2019 11:01:00 +0800 Subject: [PATCH] improve lua test --- z.lua.plugin.zsh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/z.lua.plugin.zsh b/z.lua.plugin.zsh index 9d885aa..bb35255 100644 --- a/z.lua.plugin.zsh +++ b/z.lua.plugin.zsh @@ -6,14 +6,14 @@ ZLUA_SCRIPT="${0:A:h}/z.lua" # search lua executable if [[ -z "$ZLUA_EXEC" ]]; then - if [[ -x "$(\which lua)" ]]; then - ZLUA_EXEC="$(\which lua)" - elif [[ -x "$(which lua5.3)" ]]; then - ZLUA_EXEC="$(\which lua5.3)" - elif [[ -x "$(which lua5.2)" ]]; then - ZLUA_EXEC="$(\which lua5.2)" - elif [[ -x "$(which lua5.1)" ]]; then - ZLUA_EXEC="$(\which lua5.1)" + if [[ -x "$(command which lua)" ]]; then + ZLUA_EXEC="$(command which lua)" + elif [[ -x "$(command which lua5.3)" ]]; then + ZLUA_EXEC="$(command which lua5.3)" + elif [[ -x "$(command which lua5.2)" ]]; then + ZLUA_EXEC="$(command which lua5.2)" + elif [[ -x "$(command which lua5.1)" ]]; then + ZLUA_EXEC="$(command which lua5.1)" else echo "Not find lua in your $PATH, please install it." return