Skip to content

Commit

Permalink
Introduce INPUT_DIR variable
Browse files Browse the repository at this point in the history
  • Loading branch information
nichtich committed May 29, 2024
1 parent 0e84a35 commit 29c19db
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ library specific configuration file:
| | `-c`/`--catalogue` | display name of the catalogue | `$NAME` |
| `NAME` | `-n`/`--name` | name of the catalogue | qa-catalogue |
| `BASE_INPUT_DIR` | `-d`/`--input` | parent directory of input file directories | `./input` |
| | `-d`/`--input-dir` | subdirectory of input directory to read files from | |
| `INPUT_DIR` | `-d`/`--input-dir` | subdirectory of input directory to read files from | |
| `BASE_OUTPUT_DIR` | `-o`/`--output` | parent output directory | `./output` |
| `MASK` | `-m`/`--mask` | a file mask which input files to process, e.g. `*.mrc` | `*` |
| `TYPE_PARAMS` | `-p`/`--params` | parameters to pass to individual tasks (see below) | |
Expand Down
1 change: 1 addition & 0 deletions common-script
Original file line number Diff line number Diff line change
Expand Up @@ -570,6 +570,7 @@ fatal() {
}

# initialize environment, set default values
# TODO: remove this because it's already done in ./qa-catalogue)
NAME=${NAME:-$(basename $0 .sh)}
BASE_INPUT_DIR=${BASE_INPUT_DIR:-./input}
BASE_OUTPUT_DIR=${BASE_OUTPUT_DIR:-./output}
Expand Down
1 change: 1 addition & 0 deletions docker/qa-catalogue
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ if [ ${#args[@]} == 0 ]; then
echo "variable CONTAINER). Try command 'help' for usage of QA catalogue!"
echo "Environment variables are read from .env or file given with --env-file."
else
set -x
docker container exec \
$docker_options \
"$CONTAINER" \
Expand Down
9 changes: 6 additions & 3 deletions qa-catalogue
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ 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}
MARC_DIR=${BASE_INPUT_DIR:-}

# 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 All @@ -50,7 +50,7 @@ while true; do
case "$1" in
-a|--analyses) ANALYSES=$2 ; shift ;;
-c|--catalogue) CATALOGUE=$2 ; shift ;;
-d|--input-dir) MARC_DIR=${BASE_INPUT_DIR}/$2 ; shift ;;
-d|--input-dir) INPUT_DIR=$2 ; shift ;;
-i|--input) BASE_INPUT_DIR=$2 ; shift ;;
-m|--mask) MASK=$2 ; shift ;;
-n|--name) NAME=$2 ; shift ;;
Expand All @@ -76,13 +76,16 @@ if [[ -f "$ENV_FILE" ]]; then
source "$ENV_FILE"
fi

# this should not be set by hand
MARC_DIR=$BASE_INPUT_DIR/$INPUT_DIR

cat << EOF
configuration:
---------------------------
ANALYSES: ${ANALYSES:-}
CATALOGUE: ${CATALOGUE:-}
MARC_DIR (input-dir): ${MARC_DIR:-}
BASE_INPUT_DIR (input): ${BASE_INPUT_DIR}
INPUT_DIR (input-dir): ${INPUT_DIR:-}
MASK: ${MASK}
NAME: ${NAME}
BASE_OUTPUT_DIR (output): ${BASE_OUTPUT_DIR}
Expand Down

0 comments on commit 29c19db

Please sign in to comment.