Skip to content

Commit d40e90e

Browse files
committed
Allow non provileged users to enjoy the generated .pgpass file
1 parent 9914721 commit d40e90e

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

spryker/usr/local/share/spryker/spryker_functions.sh

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,16 @@ do_spryker_app_permissions() {
4949

5050
do_spryker_config_create() (
5151
set +x
52-
echo "Creating Postgres Credentials file in /root/.pgpass"
52+
if [ "$NON_PRIVELEGED_USER" = "true" ]; then
53+
local target=~/.pgpass
54+
else
55+
local target=/root/.pgpass
56+
fi
57+
58+
echo "Creating Postgres Credentials file in "$target
5359
# create .pgpass in home directory for postgres client
54-
echo "$DATABASE_HOST:*:*:$DATABASE_USER:$DATABASE_PASSWORD" > /root/.pgpass
55-
chmod 0600 /root/.pgpass
60+
echo "$DATABASE_HOST:*:*:$DATABASE_USER:$DATABASE_PASSWORD" > $target
61+
chmod 0600 $target
5662
)
5763

5864
do_spryker_build() {

0 commit comments

Comments
 (0)