From 9ed801aecfc519bcea04c5f6c5805bff02d6b9bd Mon Sep 17 00:00:00 2001 From: MagicRB Date: Tue, 3 Oct 2023 23:52:45 +0200 Subject: [PATCH] Generalize ~show-files-to-be-deleted~ Signed-off-by: MagicRB --- overlays/show-files-to-be-deleted/default.nix | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/overlays/show-files-to-be-deleted/default.nix b/overlays/show-files-to-be-deleted/default.nix index 7f70a0c..a461e36 100644 --- a/overlays/show-files-to-be-deleted/default.nix +++ b/overlays/show-files-to-be-deleted/default.nix @@ -3,8 +3,14 @@ flake.overlays.show-files-to-be-deleted = final: prev: { show-files-to-be-deleted = final.writeShellScriptBin "show-files-to-be-deleted" '' - [ $(id -u) == 0 ] || exec sudo $0 - find / -mount -type f + if [[ "$#" != "1" ]] ; then + echo "Invalid number ($#) of argumets, one expected." + exit 1 + fi + + _mount_point="$1" + + find "$1" -mount -type f ''; }; }