Skip to content

Commit 628d188

Browse files
committed
feat: Update script to check that both psql and sqlx-cli are installed
1 parent caeaa78 commit 628d188

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

scripts/init_db.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,20 @@
22
set -x
33
set -eo pipefail
44

5+
# Check that both psql and sqlx-cli are installed
6+
if ! [ -x "$(command -v psql)" ]; then
7+
echo "Error: psql is not installed."
8+
exit 1
9+
fi
10+
11+
if ! [ -x "$(command -v sqlx)" ]; then
12+
echo "Error: sqlx is not installed."
13+
echo >&2 "Use:"
14+
echo >&2 " cargo install --version=\"0.8.0\" sqlx-cli --no-default-features --features rustls,postgres"
15+
echo >&2 " to install it."
16+
exit 1
17+
fi
18+
519
# Check if a custom user has been set, otherwise default to 'postgres'
620
DB_USER=${POSTGRES_USER:=postgres}
721
# Check if a custom password has been set, otherwise default to 'password'

0 commit comments

Comments
 (0)