Skip to content

Commit

Permalink
Fix shell syntax for parameter (#1041)
Browse files Browse the repository at this point in the history
The used syntax tries to call a non-existent `database_init_file` command:

```
Update password for user <user> ...
ALTER ROLE
Create Database <database> ...
/entrypoint.sh: line 59: database_init_file: command not found
Update User Privileges on Database ...
GRANT
```
  • Loading branch information
bgotink authored May 28, 2024
1 parent 80cd69c commit 5a258ef
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions apps/postgres-init/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,12 @@ for dbname in ${INIT_POSTGRES_DBNAME}; do
printf "\e[1;32m%-6s\e[m\n" "Create Database ${dbname} ..."
createdb --owner "${INIT_POSTGRES_USER}" "${dbname}"
database_init_file="/initdb/${dbname}.sql"
if [[ -f "$(database_init_file)" ]]; then
if [[ -f "${database_init_file}" ]]; then
printf "\e[1;32m%-6s\e[m\n" "Initialize Database ..."
psql \
--dbname "${dbname}" \
--echo-all \
--file "$(database_init_file)"
--file "${database_init_file}"
fi
fi
printf "\e[1;32m%-6s\e[m\n" "Update User Privileges on Database ..."
Expand Down

0 comments on commit 5a258ef

Please sign in to comment.