Improve make scans dir

This commit is contained in:
2024-07-29 12:45:18 -04:00
parent c323eef935
commit 5e0af19181

View File

@@ -1472,6 +1472,7 @@ main() {
TEMPLATES_DIR="$SCRIPT_DIR/templates"
APPS_DIR="$SCRIPT_DIR/apps"
DATE="$(date +%Y%m%d)" # change in EASYConsole.m to match
SCANS_HEIRARCHY=("./scans" "/mnt/data/scans" "/mnt/data/ExpJobs" "./scans")
SCANS_HEIRARCHY=("./scans" "/mnt/data/scans" "/mnt/data/ExpJobs" "./scans") # search for a scans dir in this order (and fall back to default)
# Find a scans directory
[[ -z $SCANS_DIR ]] && for d in "${SCANS_HEIRARCHY[@]}"; do
@@ -1479,6 +1480,15 @@ main() {
SCANS_DIR="$d"
fi
done
if ! [[ -d $SCANS_DIR ]]; then
# This is not somethign we do often, so ask
if ask "Create the scans directory: $SCANS_DIR?"; then
mkdir -p "$SCANS_DIR"
else
echo "No scans directory available, exiting"
exit 1;
fi
fi
echo "Using scans directory: $SCANS_DIR"
echo "Change the SCANS environment variable to override"
echo "Example: SCANS=/path/to/scans ./qhtcp-workflow"