From 8061d52d258ea020c2586d8a244f3218c997d9bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phan=20Sainl=C3=A9ger?= Date: Mon, 2 Feb 2026 17:56:40 +0100 Subject: [PATCH] [FIX] correct return statement outside function Replace 'return 1' with 'exit 1' in prepare_db.sh. The 'return' statement is only valid inside functions. When used at the script's top level, it behaves unpredictably - in some shells it exits the script, in others it's an error. Using 'exit 1' explicitly terminates the script with an error status, which is the intended behavior when the PostgreSQL container is not running. --- prepare_db.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/prepare_db.sh b/prepare_db.sh index ff87cd2..7aea271 100755 --- a/prepare_db.sh +++ b/prepare_db.sh @@ -12,7 +12,7 @@ echo "Start database preparation" # Check POSTGRES container is running if ! docker ps | grep -q "$DB_CONTAINER_NAME"; then printf "Docker container %s is not running.\n" "$DB_CONTAINER_NAME" >&2 - return 1 + exit 1 fi EXT_EXISTS=$(query_postgres_container "SELECT 1 FROM pg_extension WHERE extname = 'dblink'" "$DB_NAME") || exit 1