mirror of
https://github.com/eRgo35/dots.git
synced 2025-12-17 07:56:11 +01:00
funny fish
This commit is contained in:
11
.config/fish/functions/__z_clean.fish
Normal file
11
.config/fish/functions/__z_clean.fish
Normal file
@@ -0,0 +1,11 @@
|
||||
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
|
||||
Reference in New Issue
Block a user