From 75eb9e804ce7ddd016c3c89012f8363a7d77ba4f Mon Sep 17 00:00:00 2001 From: 0x1eef <0x1eef@protonmail.com> Date: Mon, 15 Apr 2024 15:22:49 -0300 Subject: [PATCH] Combine find with -delete for empty directories --- libexec/portzap/portzap-install | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/libexec/portzap/portzap-install b/libexec/portzap/portzap-install index e858991..952b6da 100755 --- a/libexec/portzap/portzap-install +++ b/libexec/portzap/portzap-install @@ -20,9 +20,7 @@ perform_update() parent=$(dirname "${target}") echo "rm ${target}" rm -f "${target}" - if [ -e "${parent}" ]; then - find "${parent}" -type d -maxdepth 0 -empty -exec rm -rf {} \; - fi + find "${parent}" -type d -maxdepth 0 -empty -delete done for file in ${add}; do target="${installdir}/${file}"