From 66b66a5a3dab76209815c82929296591a54c30cc Mon Sep 17 00:00:00 2001 From: MichaIng Date: Wed, 30 Jul 2025 01:10:47 +0200 Subject: [PATCH] discourse-doctor: support custom app names as CLI arg While `launcher` allows to pass any container/app name as CLI argument, `discourse-doctor` does not, but support two hardcoded names only. This commit adds support for custom names taken from first CLI argument. It is done in a non-breaking change. If the argument is empty, or the related YAML file does not exist, it continues to check for the two hardcoded names like before. Signed-off-by: MichaIng --- discourse-doctor | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/discourse-doctor b/discourse-doctor index 9f892361b..7d9de335e 100755 --- a/discourse-doctor +++ b/discourse-doctor @@ -1,6 +1,7 @@ #!/usr/bin/env bash LOG_FILE="/tmp/discourse-debug.txt" WORKING_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +app_name="$1" log() { if [ "$1" == "-e" ] @@ -237,8 +238,12 @@ check_email() { } get_yml_file() { - app_name="" - if [ -f containers/app.yml ] + if [ -n "$app_name" ] && [ -f "containers/$app_name.yml" ] + then + log "Using app name '$app_name' from command argument" + web_file="containers/$app_name.yml" + log "Found $web_file" + elif [ -f containers/app.yml ] then app_name="app" web_file=containers/$app_name.yml