🐛 fix(fish): function to open yazi
This commit is contained in:
parent
c2d6c8a20a
commit
a1702602bc
1 changed files with 5 additions and 9 deletions
|
@ -1,12 +1,8 @@
|
|||
function fe
|
||||
if type -f yazi &>/dev/null
|
||||
set tmp (mktemp -t "yazi-cwd.XXXXX")
|
||||
yazi --cwd-file="$tmp"
|
||||
if set cwd (cat -- "$tmp"); and [ -n "$cwd" ]; and [ "$cwd" != "$PWD" ]
|
||||
cd -- "$cwd"
|
||||
end
|
||||
rm -f -- "$tmp"
|
||||
else
|
||||
missing_package yazi
|
||||
set tmp (mktemp -t "yazi-cwd.XXXXXX")
|
||||
yazi $argv --cwd-file="$tmp"
|
||||
if set cwd (command cat -- "$tmp"); and [ -n "$cwd" ]; and [ "$cwd" != "$PWD" ]
|
||||
builtin cd -- "$cwd"
|
||||
end
|
||||
rm -f -- "$tmp"
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue