mirror of
https://github.com/nix-community/home-manager
synced 2024-11-24 03:59:46 +01:00
home-environment: avoid harmless but scary error message
(cherry picked from commit 5862a05fb1
)
This commit is contained in:
parent
0ef0be8ffb
commit
7f2eacfe49
1 changed files with 11 additions and 2 deletions
|
@ -315,8 +315,17 @@ in
|
||||||
else
|
else
|
||||||
echo "Checking $targetPath gone (deleting)"
|
echo "Checking $targetPath gone (deleting)"
|
||||||
$DRY_RUN_CMD rm $VERBOSE_ARG "$targetPath"
|
$DRY_RUN_CMD rm $VERBOSE_ARG "$targetPath"
|
||||||
$DRY_RUN_CMD rmdir --ignore-fail-on-non-empty \
|
targetDir="$(dirname "$targetPath")"
|
||||||
$VERBOSE_ARG -p "$(dirname "$targetPath")"
|
|
||||||
|
# Recursively remove the containing directory. We only
|
||||||
|
# do this if the containing folder is not $HOME since
|
||||||
|
# running rmdir on $HOME will result in a harmless but
|
||||||
|
# unpleasant error message.
|
||||||
|
if [[ "$targetDir" != "$HOME" ]] ; then
|
||||||
|
$DRY_RUN_CMD rmdir $VERBOSE_ARG \
|
||||||
|
-p --ignore-fail-on-non-empty \
|
||||||
|
"$targetDir"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
'';
|
'';
|
||||||
|
|
Loading…
Reference in a new issue