From 1616c7cb11d5e90ef7b48967b22afd0765e04361 Mon Sep 17 00:00:00 2001 From: Christian Winther Date: Fri, 26 Jan 2024 20:45:56 +0000 Subject: [PATCH] make directory-is-empty more robust --- docker/shared/root/docker/helpers.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/shared/root/docker/helpers.sh b/docker/shared/root/docker/helpers.sh index 51be8550..1589e078 100644 --- a/docker/shared/root/docker/helpers.sh +++ b/docker/shared/root/docker/helpers.sh @@ -324,7 +324,7 @@ function file-exists() # @exitcode 1 If $1 does *NOT* contain files function directory-is-empty() { - [ -z "$(ls -A "${1}")" ] + path-exists "${1}" && [[ -z "$(ls -A "${1}")" ]] } # @description Ensures a directory exists (via mkdir)