From 4875b7f47f75b8319dd6c6553cffa9d2b6ebcb7a Mon Sep 17 00:00:00 2001 From: 0x1eef <0x1eef@protonmail.com> Date: Wed, 10 Apr 2024 19:25:10 -0300 Subject: [PATCH] Remove empty directories --- libexec/portzap/portzap-install | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libexec/portzap/portzap-install b/libexec/portzap/portzap-install index 7f78104..03595bf 100755 --- a/libexec/portzap/portzap-install +++ b/libexec/portzap/portzap-install @@ -19,7 +19,9 @@ perform_update() set -x for file in ${del}; do target="${installdir}/${file}" + parent=$(dirname "${target}") rm "${target}" + find "${parent}" -type d -maxdepth 0 -empty -exec rm -rf {} \; done for file in ${add}; do target="${installdir}/${file}"