Funced: Make removal safer, take two

Now we try to remove the file and then the directory, without forcing
anything, showing any (quite unexpected) error to the user, once.
This commit is contained in:
Fabian Homborg 2016-05-28 12:34:04 +02:00
parent ffcfe73299
commit d79a5a3152

View file

@ -124,8 +124,7 @@ function funced --description 'Edit function definition'
break break
end end
set -l stat $status set -l stat $status
# Only forcibly delete files to limit possible damage is tmpdir is set to something weird rm $tmpname >/dev/null
rm -f $tmpname >/dev/null and rmdir $tmpdir >/dev/null
rm -r $tmpdir >/dev/null
return $stat return $stat
end end