From 4a55cad211a738866f22b0b3f47ae0b4ee85fe82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dennis=20Vestergaard=20V=C3=A6rum?= Date: Wed, 14 Jun 2023 23:48:54 +0200 Subject: [PATCH] Fix bug - that would make docker-entrypoint.sh failed, hook folders was empty MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Dennis Vestergaard Værum --- docker-entrypoint.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 71fc03bb..941dc3ee 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -24,7 +24,12 @@ run_path() { local hook_folder_path="/docker-entrypoint-hooks.d/$1" local return_code=0 - echo "=> Searching for scripts (*.sh) to run in the folder: ${hook_folder_path}" + echo "=> Searching for scripts (*.sh) to run, located in the folder: ${hook_folder_path}" + + if [ -z "$(ls -A "${hook_folder_path}")" ]; then + echo "==> but the hook folder \"$(basename "${hook_folder_path}")\" is empty, so nothing to do" + return 0 + fi ( for script_file_path in "${hook_folder_path}/"*.sh; do