From b090430cd897313589e81e97d8c67a71144408b2 Mon Sep 17 00:00:00 2001 From: Michael Housh Date: Thu, 6 Nov 2025 15:26:13 -0500 Subject: [PATCH] feat: Adds '--date' option to hpa-create script to allow date override when generating a new project. --- env/.local/scripts/utils/hpa/hpa-create | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/env/.local/scripts/utils/hpa/hpa-create b/env/.local/scripts/utils/hpa/hpa-create index 0ff99e9..f0818aa 100755 --- a/env/.local/scripts/utils/hpa/hpa-create +++ b/env/.local/scripts/utils/hpa/hpa-create @@ -17,9 +17,10 @@ LOG_FILE=${LOG_FILE:-"$LOG_LABEL.log"} # Load environment / shared variables. . "$SCRIPTS/utils/hpa/hpa.env" -declare no_git_flag no_push_flag +declare no_git_flag no_push_flag date_opt no_git_flag="0" no_push_flag="0" +date_opt=$(date '+%Y.%m.%d') usage() { cat < FLAGS: - -h | --help: Show this help page. + -d | --date: Override the date the project was started. -g | --no-git: Do not initialize a git repository for the project. + -h | --help: Show this help page. -p | --no-push: Do not push project to remote repository. ENVIRONMENT: @@ -74,7 +76,7 @@ create() { log "Generating project for: '$customer'" container_dir=$( - "$SCRIPTS/hpa" create --quiet "/consults/$(date '+%Y.%m.%m').$customer" + "$SCRIPTS/hpa" create --quiet "/consults/$date_opt.$customer" ) echo "$HPA_CONSULTS_DIR/$(basename "$container_dir")" } @@ -124,6 +126,9 @@ declare customer output while [[ $# -gt 0 ]]; do if [[ $1 == "-h" ]] || [[ $1 == "--help" ]]; then usage && exit 0 + elif [[ $1 == "-d" ]] || [[ $1 == "--date" ]]; then + shift + date_opt="$1" elif [[ $1 == "-g" ]] || [[ $1 == "--no-git" ]]; then no_git_flag="1" elif [[ $1 == "-p" ]] || [[ $1 == "--no-push" ]]; then