From 97fad3a56fc95468770897c294ca671ac71bc6c6 Mon Sep 17 00:00:00 2001 From: EdyTheCow Date: Wed, 8 Oct 2025 22:56:20 +0200 Subject: [PATCH] Fix empty dir check function --- whmcs-nginx/config/lib/whmcs-lib.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/whmcs-nginx/config/lib/whmcs-lib.sh b/whmcs-nginx/config/lib/whmcs-lib.sh index 5c282aa..aa1fd34 100644 --- a/whmcs-nginx/config/lib/whmcs-lib.sh +++ b/whmcs-nginx/config/lib/whmcs-lib.sh @@ -17,7 +17,8 @@ die() { echo "[whmcs-init][ERROR] $*" >&2; exit 1; } is_empty_dir() { # empty if no entries except possible .gitignore - [ -z "$(find "$1" -mindepth 1 -maxdepth 1 -not -name '.gitignore' -print -quit 2>/dev/null)" ] + [ -d "$1" ] || return 2 + [ -z "$(find "$1" -mindepth 1 -maxdepth 1 ! -name '.gitignore' -print 2>/dev/null | head -n 1)" ] } ensure_tree_if_empty() {