Fix z, go to home without arg and remove non deleted folders

This commit is contained in:
Tim 2025-05-21 16:10:07 +02:00
parent e7fa8113a6
commit fb42de7375

View File

@ -140,7 +140,11 @@ function __z -d "Jump to a recent directory."
return
end
set target (command awk -v t=(date +%s) -v typ="$typ" -v q="$q" -F "|" $z_script "$Z_DATA")
if set -q q[1]
set target (command awk -v t=(date +%s) -v typ="$typ" -v q="$q" -F "|" $z_script "$Z_DATA")
else
set target (path resolve $HOME)
end
if test "$status" -gt 0
return
@ -168,7 +172,11 @@ function __z -d "Jump to a recent directory."
type -q open; and open "$target"; and return $status
echo "Not sure how to open file manager"; and return 1
end
else
else if test -d $target
pushd "$target"
else
echo "Folder '$target' does not exist anymore, removing from z_data"
sed -i -e "\:^$target|.*:d" $Z_DATA
__z $argv
end
end