We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fd3a77a commit 48b3f5dCopy full SHA for 48b3f5d
setup-db.sh
@@ -1,7 +1,5 @@
1
#!/usr/bin/env bash
2
3
-set -xe
4
-
5
DATABASE_URL="${DATABASE_URL:-postgres://postgres:ughfineokifitsfordebugging@localhost:54320/rfcbot}"
6
7
until psql -d "$DATABASE_URL" -c '\q'; do
@@ -11,8 +9,17 @@ done
11
9
12
10
>&2 echo "Postgres is up - executing commands"
13
+set -e
14
diesel database setup
15
diesel migration run
16
-psql -q -d "$DATABASE_URL" --file ./githubuser-backup.pg
+set +e
+
17
+sql_output="$(psql -q -d "$DATABASE_URL" --file ./githubuser-backup.pg)"
18
+sql_status="$?"
19
20
+if [ ! $sql_status ]; then
21
+ echo "$sql_output"
22
+ exit $sql_status
23
+fi
24
25
exec "$@"
0 commit comments