install: Run git config commands from a known readable cwd.

Fixes this error when running the installer from a directory that
isn’t world-readable:

+ su zulip -c 'git config --global user.email anders@zulip.com'
fatal: cannot come back to cwd: Permission denied

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg 2021-05-13 21:27:35 -07:00 committed by Tim Abbott
parent bc45525369
commit 09f6ba1971
1 changed files with 5 additions and 2 deletions

View File

@ -524,8 +524,11 @@ if has_class "zulip::app_frontend_base"; then
fi fi
# Set up a basic .gitconfig for the 'zulip' user # Set up a basic .gitconfig for the 'zulip' user
su zulip -c "git config --global user.email $ZULIP_ADMINISTRATOR" (
su zulip -c "git config --global user.name 'Zulip Server ($EXTERNAL_HOST)'" cd / # Make sure the current working directory is readable by zulip
su zulip -c "git config --global user.email $ZULIP_ADMINISTRATOR"
su zulip -c "git config --global user.name 'Zulip Server ($EXTERNAL_HOST)'"
)
if [ -n "$NO_INIT_DB" ]; then if [ -n "$NO_INIT_DB" ]; then
set +x set +x