More helpful usage messages for test/create_test_db
This commit is contained in:
committed by
Steve Chávez
parent
ea2f89e234
commit
e34669b137
+13
-9
@@ -1,19 +1,23 @@
|
||||
#! /usr/bin/env bash
|
||||
if [ -z "$1" ]
|
||||
then
|
||||
echo "Please supply the connection uri for the user with create database privileges"
|
||||
|
||||
usage() {
|
||||
echo "$0 <db-uri> <test-database>"
|
||||
exit -1
|
||||
}
|
||||
|
||||
if [ -z "$1" ]; then
|
||||
echo "Please supply the connection uri for the user with create database privileges"
|
||||
usage
|
||||
fi
|
||||
|
||||
if [ -z "$2" ]
|
||||
then
|
||||
if [ -z "$2" ]; then
|
||||
echo "Please supply the test database name"
|
||||
exit -1
|
||||
usage
|
||||
fi
|
||||
if [[ $1 != postgres://* ]]
|
||||
then
|
||||
|
||||
if [[ $1 != postgres://* ]]; then
|
||||
echo "Please use a valid connection URI (https://www.postgresql.org/docs/current/static/libpq-connect.html#AEN45347)"
|
||||
exit -1
|
||||
usage
|
||||
fi
|
||||
|
||||
BASEPATH=$( cd $(dirname $0) ; pwd -P )
|
||||
|
||||
Reference in New Issue
Block a user