multiple-outputs.sh: silence 'rmdir: failed to remove ... Directory not empty'
++ rmdir /nix/store/6f233lsgbqv87w4nmzpsdaydwhyapps6-at-spi2-core-aarch64-unknown-linux-gnu-2.46.0/lib rmdir: failed to remove '/nix/store/6f233lsgbqv87w4nmzpsdaydwhyapps6-at-spi2-core-aarch64-unknown-linux-gnu-2.46.0/lib': Directory not empty
This commit is contained in:
parent
255f62ed45
commit
9c72ea8725
|
@ -138,9 +138,9 @@ moveToOutput() {
|
|||
|
||||
# remove empty directories, printing iff at least one gets removed
|
||||
local srcParent="$(readlink -m "$srcPath/..")"
|
||||
if rmdir "$srcParent"; then
|
||||
if [ -n "$(find "$srcParent" -maxdepth 0 -type d -empty 2>/dev/null)" ]; then
|
||||
echo "Removing empty $srcParent/ and (possibly) its parents"
|
||||
rmdir -p --ignore-fail-on-non-empty "$(readlink -m "$srcParent/..")" \
|
||||
rmdir -p --ignore-fail-on-non-empty "$srcParent" \
|
||||
2> /dev/null || true # doesn't ignore failure for some reason
|
||||
fi
|
||||
done
|
||||
|
|
Loading…
Reference in a new issue