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