🐛 fix(fish): function to open yazi

This commit is contained in:
Sergio Laín 2024-10-13 01:24:06 +02:00
parent c2d6c8a20a
commit a1702602bc
No known key found for this signature in database
GPG key ID: 8429B2EE312F8150

View file

@ -1,12 +1,8 @@
function fe function fe
if type -f yazi &>/dev/null set tmp (mktemp -t "yazi-cwd.XXXXXX")
set tmp (mktemp -t "yazi-cwd.XXXXX") yazi $argv --cwd-file="$tmp"
yazi --cwd-file="$tmp" if set cwd (command cat -- "$tmp"); and [ -n "$cwd" ]; and [ "$cwd" != "$PWD" ]
if set cwd (cat -- "$tmp"); and [ -n "$cwd" ]; and [ "$cwd" != "$PWD" ] builtin cd -- "$cwd"
cd -- "$cwd"
end end
rm -f -- "$tmp" rm -f -- "$tmp"
else
missing_package yazi
end
end end