Recursively remove NIX_BUILD_TOP

Fixes #187
This commit is contained in:
Bryan Bennett 2022-05-24 08:21:32 -04:00
parent bca290c875
commit a4d24b9052
No known key found for this signature in database
GPG key ID: EF90E3E98B8F5C0B

View file

@ -99,8 +99,9 @@ _nix_import_env() {
# We cannot rely on this directory being availble at all times, # We cannot rely on this directory being availble at all times,
# as it may be garbage collected. # as it may be garbage collected.
# Instead - just remove it immediately. # Instead - just remove it immediately.
# Use recursive & force as it may not be empty.
if [[ "$NIX_BUILD_TOP" == */nix-shell.* && -d "$NIX_BUILD_TOP" ]]; then if [[ "$NIX_BUILD_TOP" == */nix-shell.* && -d "$NIX_BUILD_TOP" ]]; then
rmdir "$NIX_BUILD_TOP" rm -rf "$NIX_BUILD_TOP"
fi fi
_nix_export_or_unset NIX_BUILD_TOP "$old_nix_build_top" _nix_export_or_unset NIX_BUILD_TOP "$old_nix_build_top"