From 36c0d6ee6be27a450e03770b1cea1fde04a721fa Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Thu, 7 Sep 2023 20:19:35 -0600 Subject: [PATCH] Update entrypoint.sh --- entrypoint.sh | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index fb85c65..3c0c14d 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -55,20 +55,27 @@ if [[ -n "$INPUT_POSTGRESQL_VERSION" ]]; then exit 1 fi - if [[ "$(uname -s)" == "NT"* ]]; then - echo "/Program Files/PostgreSQL/15/bin" >> "$GITHUB_PATH" - else - echo "/usr/lib/postgresql/15/bin" >> "$GITHUB_PATH" - fi - echo "Installed postgresql" + + echo "Running pg_dump..." + + # Verify installation by running pg_dump directly + if [[ "$(uname -s)" == "NT"* ]]; then + "/Program Files/PostgreSQL/15/bin/pg_dump" --version + # shellcheck disable=SC2086 + "/Program Files/PostgreSQL/15/bin/pg_dump" $INPUT_OPTIONS -d "$INPUT_DATABASE_URL" > "$INPUT_PATH" + else + "/usr/lib/postgresql/15/bin/pg_dump" --version + # shellcheck disable=SC2086 + "/usr/lib/postgresql/15/bin/pg_dump" $INPUT_OPTIONS -d "$INPUT_DATABASE_URL" > "$INPUT_PATH" + fi +else + echo "Running pg_dump..." + + # shellcheck disable=SC2086 + pg_dump $INPUT_OPTIONS -d "$INPUT_DATABASE_URL" > "$INPUT_PATH" fi -echo "Running pg_dump..." - -# shellcheck disable=SC2086 -pg_dump $INPUT_OPTIONS -d "$INPUT_DATABASE_URL" > "$INPUT_PATH" - echo "Complete" echo "::endgroup::"