From f2a266a51d7f6cc7f24a076d28a154aeaedea66f Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Fri, 8 Sep 2023 01:54:30 +0000 Subject: [PATCH] Updated to check for the output dir --- entrypoint.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index dbab0e2..c18968d 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -4,11 +4,15 @@ set -euo pipefail echo "::group::pg-dump" -echo "Creating the output directory..." +echo "Checking if the output directory exists..." -mkdir -p "$(dirname "$INPUT_PATH")" - -echo "Created the output directory" +if [ ! -d "$(dirname "$INPUT_PATH")" ]; then + echo "The output directory does not exist. Creating it..." + mkdir -p "$(dirname "$INPUT_PATH")" + echo "Created the output directory" +else + echo "The output directory already exists" +fi if [[ -n "$INPUT_POSTGRESQL_VERSION" ]]; then echo "Verifying version"