Fix out_dir

This commit is contained in:
2024-07-31 15:29:42 -04:00
parent dd583ddd83
commit 124c7696ba

View File

@@ -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