Skip to content

Commit

Permalink
[#70] Fix bug in running post-initdb script
Browse files Browse the repository at this point in the history
For some strange reason, the post-initdb script holding variable was
named `PGENV_SCRIPT_INITDB` but in the configuration was searched for
as `PGENV_SCRIPT_POSTINITDB`. Since the configuration generates the
latter, I fixed the test in `pgenv_initdb()` to use
`PGENV_SCRIPT_POSTINITDB`.

Bumps the version number.

Close #70
  • Loading branch information
fluca1978 committed Apr 8, 2024
1 parent bc6c1de commit 719039a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions bin/pgenv
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# VERSION
#
PGENV_VERSION="1.3.4"
PGENV_VERSION="1.3.5"

# https://stackoverflow.com/a/19622569/79202
trap 'exit' ERR
Expand Down Expand Up @@ -961,9 +961,9 @@ pgenv_initdb(){
$INITDB -D "$PG_DATA" "${PGENV_INITDB_OPTIONS[@]}"

# if there is a post-initdb script to run, run it
if [ -x "$PGENV_SCRIPT_INITDB" ]; then
echo "Running post-initdb script [$PGENV_SCRIPT_INITDB]"
$PGENV_SCRIPT_INITDB "$PG_DATA"
if [ -x "$PGENV_SCRIPT_POSTINITDB" ]; then
echo "Running post-initdb script [$PGENV_SCRIPT_POSTINITDB]"
$PGENV_SCRIPT_POSTINITDB "$PG_DATA"
fi

else
Expand Down

0 comments on commit 719039a

Please sign in to comment.