mirror of
https://github.com/zulip/zulip.git
synced 2025-11-05 22:43:42 +00:00
postgres-init-db: Fix shellcheck warnings.
In scripts/setup/postgres-init-db line 12:
records=`su "$POSTGRES_USER" -c "psql -Atc 'SELECT COUNT(*) FROM zulip.zerver_message;' zulip" | cat`
^-- SC2006: Use $(..) instead of legacy `..`.
In scripts/setup/postgres-init-db line 35:
source "$(dirname "$0")/terminate-psql-sessions" postgres zulip zulip_base
^-- SC1090: Can't follow non-constant source. Use a directive to specify location.
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
This commit is contained in:
committed by
Tim Abbott
parent
edc5a7bdd0
commit
e495eaa339
@@ -9,7 +9,7 @@ POSTGRES_USER="${POSTGRES_USER:-postgres}"
|
||||
# We have to do this because on production database zulip may not exist, so psql
|
||||
# will fail with return code 2. Because set -e is on, this will cause the script
|
||||
# to bail.
|
||||
records=`su "$POSTGRES_USER" -c "psql -Atc 'SELECT COUNT(*) FROM zulip.zerver_message;' zulip" | cat`
|
||||
records=$(su "$POSTGRES_USER" -c "psql -Atc 'SELECT COUNT(*) FROM zulip.zerver_message;' zulip" | cat)
|
||||
|
||||
if [[ $records -gt 200 ]]
|
||||
then
|
||||
@@ -32,6 +32,7 @@ fi
|
||||
# Drop any open connections to any old database. Hackishly call using
|
||||
# `source`, because postgres user may not be able to read this directory
|
||||
# if unpacked by root.
|
||||
# shellcheck source=/dev/null
|
||||
source "$(dirname "$0")/terminate-psql-sessions" postgres zulip zulip_base
|
||||
|
||||
(
|
||||
|
||||
Reference in New Issue
Block a user