zsh:funcs: Add rmdir wrapper to delete CWD

This commit is contained in:
2023-07-10 00:12:07 +02:00
parent 494829fdc4
commit 2d277c5f54

View File

@@ -705,3 +705,16 @@ diffcmds() {
done
eval "$cmdline[@]"
}
# Allow to delete current working dir
rmdir() {
emulate -L zsh
if (( $# == 1 )) && [[ $1 == '.' ]]; then
to_del="$PWD"
cd ..
command rmdir "$to_del"
else
command rmdir "$@"
fi
}