Combine find with -delete for empty directories

This commit is contained in:
0x1eef 2024-04-15 15:22:49 -03:00
parent a6c7ab818a
commit 75eb9e804c

View file

@ -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}"