pkgs/common/hooks/post-install/03-remove-empty-dirs.sh
2023-11-12 16:04:24 -05:00

10 lines
321 B
Bash

# This hooks removes empty dirs and warns about them.
hook() {
if [ -d "${PKGDESTDIR}" ]; then
find "${PKGDESTDIR}" -mindepth 1 -type d -empty -print -delete|sort -r|while read -r f; do
_dir="${f##${PKGDESTDIR}}"
msg_warn "$pkgver: removed empty dir: ${_dir}\n"
done
fi
}