Beginning debug/cleanup

This commit is contained in:
2024-07-29 11:17:21 -04:00
parent e734dcd93a
commit 1e92e97110

View File

@@ -229,14 +229,19 @@ err() { echo "Error: $*" >&2; }
ask_pn() {
unset PROJECT
declare -g PROJECT
example_pn="${PROJECT_PREFIX}_$(random_words 3)"
cat <<-EOF
Enter a new or existing project name, ex. ${PROJECT_PREFIX}_$(random_words 3)
Enter a new or existing project name
If entering a new project, use the suggested prefix: ${PROJECT_PREFIX}_
You may choose any combination of words/characters following the prefix, but be sensible.
Make it descriptive and avoid spaces and special characters.
Example: ${example_pn}
EOF
read -r -p "Enter a new or existing project name: " PROJECT
[[ -z $PROJECT ]]
read -r -p "Enter a new or existing project name ($example_pn): " PROJECT
if [[ -z $PROJECT ]]; then
echo "Setting project name to the default: $example_pn"
PROJECT="$example_pn"
fi
}
debug() { (( DEBUG )) && echo "Debug: $*"; }
# Not super portable but nice to have
@@ -691,7 +696,6 @@ qhtcp() {
STUDIES_ARCHIVE_FILE="$OUT_DIR/StudiesDataArchive.txt"
QHTCP_PROJECT_DIR="$OUT_DIR/$PROJECT"
APPS_DIR="$QHTCP_PROJECT_DIR/apps"
CODE_DIR="$QHTCP_PROJECT_DIR/Code" # legacy location, keeping until can port each script to APPS
STUDY_INFO_FILE="$QHTCP_PROJECT_DIR/StudyInfo.csv"
if [[ -d $QHTCP_PROJECT_DIR ]]; then
@@ -1089,7 +1093,7 @@ r_gta_heatmaps() {
EOF
script="$CODE_DIR/TSHeatmaps5dev2.R"
script="$APPS_DIR/r/TSHeatmaps5dev2.R"
[[ -d $5 ]] || mkdir -p "$5"
@@ -1468,9 +1472,9 @@ main() {
SCANS_DIR="$d"
fi
done
echo "Scans directory: $SCANS_DIR"
echo "Using scans directory: $SCANS_DIR"
echo "Change the SCANS environment variable to override"
echo "Example: SCANS=/path/to/other/scans ./qhtcp-workflow.sh"
echo "Example: SCANS=/path/to/scans ./qhtcp-workflow"
# Set the automatic project directory prefix
PROJECT_USER="$(whoami)"