1
0
mirror of https://github.com/skywind3000/z.lua synced 2026-03-16 04:39:49 +00:00

fix Monterey initialization issues

This commit is contained in:
skywind3000
2022-03-27 21:51:29 +08:00
parent e2cce39ee4
commit a8e92e0216
2 changed files with 7 additions and 4 deletions

9
z.lua
View File

@@ -4,7 +4,7 @@
-- z.lua - a cd command that learns, by skywind 2018-2022
-- Licensed under MIT license.
--
-- Version 1.8.14, Last Modified: 2022/01/30 21:53
-- Version 1.8.15, Last Modified: 2022/03/27 21:38
--
-- * 10x faster than fasd and autojump, 3x faster than z.sh
-- * available for posix shells: bash, zsh, sh, ash, dash, busybox
@@ -527,13 +527,16 @@ function os.path.abspath(path)
return test
end
end
for _, python in pairs({'python', 'python2', 'python3'}) do
for _, python in pairs({'python3', 'python2', 'python'}) do
local s = 'sys.stdout.write(os.path.abspath(sys.argv[1]))'
local s = '-c "import os, sys;' .. s .. '" \'' .. path .. '\''
local s = python .. ' ' .. s
local test = os.path.which(python)
if test ~= nil and test ~= '' then
return os.call(s)
test = os.call(s)
if test ~= nil and test ~= '' then
return test
end
end
end
end

View File

@@ -9,7 +9,7 @@ fi
# search lua executable
if [[ -z "$ZLUA_EXEC" ]]; then
for lua in lua luajit lua5.3 lua5.2 lua5.1; do
for lua in lua luajit lua5.4 lua5.3 lua5.2 lua5.1; do
ZLUA_EXEC="$(command -v "$lua")"
[[ -n "$ZLUA_EXEC" ]] && break
done