Skip to content

Commit

Permalink
qa-catalogue: use .env instead of setdir.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
nichtich committed May 29, 2024
1 parent 29c19db commit 4a0fd6c
Showing 1 changed file with 11 additions and 15 deletions.
26 changes: 11 additions & 15 deletions qa-catalogue
Original file line number Diff line number Diff line change
Expand Up @@ -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: -- "$@")

Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 4a0fd6c

Please sign in to comment.