From 4a0fd6cbb70f1c79ad50416f85331c1506bc527a Mon Sep 17 00:00:00 2001 From: Jakob Voss Date: Wed, 29 May 2024 10:29:28 +0200 Subject: [PATCH] qa-catalogue: use .env instead of setdir.sh --- qa-catalogue | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/qa-catalogue b/qa-catalogue index 88e13904..4b1353e4 100755 --- a/qa-catalogue +++ b/qa-catalogue @@ -20,27 +20,13 @@ Options: -u --update last modification time of input files (default: timestamps) -v --version optional version number/date of the catalogue to compare changes -w --web-config update the specified configuration file of qa-catalogue-web - -f --env-file configuration file with catalogue specific environment variables + -f --env-file configuration file to override options EOF . ./common-script help exit } -# optionally load default values -[ -f ./setdir.sh ] && . ./setdir.sh - -# default values, if not set -BASE_INPUT_DIR=${BASE_INPUT_DIR:-./input} -BASE_OUTPUT_DIR=${BASE_OUTPUT_DIR:-./output} -MASK=${MASK:-*} -NAME=${NAME:-qa-catalogue} -INPUT_DIR=${INPUT_DIR:-$NAME} -TYPE_PARAMS=${TYPE_PARAMS:-} -SCHEMA=${SCHEMA:-MARC21} -WEB_CONFIG=${WEB_CONFIG:-} -ENV_FILE=${ENV_FILE:-.env} - # parse command line options options=$(getopt -o a:c:d:i:m:n:o:p:s:u:v:w:f: --long analyses:,catalogue:,input-dir:,input:,mask:,name:,output:,params:,schema:,update:,version:,web-config:,env-file: -- "$@") @@ -76,6 +62,16 @@ if [[ -f "$ENV_FILE" ]]; then source "$ENV_FILE" fi +# default values, if not set +BASE_INPUT_DIR=${BASE_INPUT_DIR:-./input} +BASE_OUTPUT_DIR=${BASE_OUTPUT_DIR:-./output} +MASK=${MASK:-*} +NAME=${NAME:-qa-catalogue} +INPUT_DIR=${INPUT_DIR:-$NAME} +TYPE_PARAMS=${TYPE_PARAMS:-} +SCHEMA=${SCHEMA:-MARC21} +WEB_CONFIG=${WEB_CONFIG:-} + # this should not be set by hand MARC_DIR=$BASE_INPUT_DIR/$INPUT_DIR