From 6e93dcd90c31eebb95c96a7746b9846130904e3a Mon Sep 17 00:00:00 2001 From: Matteo Nastasi Date: Tue, 8 Oct 2019 09:19:19 +0200 Subject: [PATCH] add override configuration file option to builder.sh --- sql/builder.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/sql/builder.sh b/sql/builder.sh index f67fa23..16dafab 100755 --- a/sql/builder.sh +++ b/sql/builder.sh @@ -8,7 +8,7 @@ DATECUR="$(date +%s)" # functions usage () { echo " USAGE" - echo " $0 [-d|--dryrun] [<-a|--allfiles>|<-p|--devfiles>] [-s|--short] ..." + echo " $0 [-c|--config ] [-d|--dryrun] [<-a|--allfiles>|<-p|--devfiles>] [-s|--short] ..." echo " $0 <-h|--help|help>" echo " commands are:" echo " create" @@ -77,6 +77,10 @@ shift while [ $# -gt 0 ]; do case $1 in + -c|--config) + CONFIG_FILE=$2 + shift + ;; -d|--dryrun) DRY_RUN=y psql () { @@ -117,6 +121,10 @@ if [ -f $HOME/.brisk_install ]; then source $HOME/.brisk_install fi +if [ -f "$CONFIG_FILE" ]; then + source "$CONFIG_FILE" +fi + pg_args="" test "$DBHOST" != "" && pg_args="$pg_args -h $DBHOST" test "$DBUSER" != "" && pg_args="$pg_args -U $DBUSER" -- 2.17.1