From 124c7696ba75eba24e00f9203d87eb560e8c8128 Mon Sep 17 00:00:00 2001 From: Bryan Roessler Date: Wed, 31 Jul 2024 15:29:42 -0400 Subject: [PATCH] Fix out_dir --- workflow/qhtcp-workflow | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/workflow/qhtcp-workflow b/workflow/qhtcp-workflow index 8c4eb123..ad7556c6 100755 --- a/workflow/qhtcp-workflow +++ b/workflow/qhtcp-workflow @@ -1479,18 +1479,11 @@ documentation() { main() { debug "Running: ${FUNCNAME[0]}" "$@" - # Where are we located? + # Where are we SCRIPT=$(realpath -s "${BASH_SOURCE[0]}") SCRIPT_DIR=$(dirname "$SCRIPT") # Global directory variables - local out_heirarchy=("$OUT_DIR" "$SCRIPT_DIR/out" "/mnt/data/out") - for d in "${out_heirarchy[@]}"; do - if [[ -d $d ]]; then - debug "Using output directory: $d" - OUT_DIR="$d" - fi - done TEMPLATES_DIR="$SCRIPT_DIR/templates" APPS_DIR="$SCRIPT_DIR/apps" DATE="$(date +%Y%m%d)" # change in EASYConsole.m to match @@ -1515,6 +1508,14 @@ main() { echo "Change the SCANS environment variable to override" echo "Example: SCANS=/path/to/scans ./qhtcp-workflow" + local out_heirarchy=("$(dirname "$SCANS_DIR")/out" "$SCRIPT_DIR/out" "/mnt/data/out") + for d in "${out_heirarchy[@]}"; do + if [[ -d $d ]]; then + debug "Using output directory: $d" + OUT_DIR="$d" + fi + done + # Set the automatic project directory prefix PROJECT_USER="$(whoami)" PROJECT_PREFIX="${DATE}_${PROJECT_USER}" # reversed these so easier to sort and parse date