1
0
Fork 0
fishdots/functions/__z_clean.fish

12 lines
341 B
Fish
Raw Normal View History

2024-06-28 12:48:25 +00:00
function __z_clean -d "Clean up .z file to remove paths no longer valid"
set -l tmpfile (mktemp $Z_DATA.XXXXXX)
if test -f $tmpfile
while read line
set -l path (string split '|' $line)[1]
test -d $path; and echo $line
end <$Z_DATA >$tmpfile
command mv -f $tmpfile $Z_DATA
end
end