Skip to content

Commit c73028a

Browse files
MichaIngandrewschleifer
authored andcommitted
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 <[email protected]>
1 parent ae4887a commit c73028a

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

discourse-doctor

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/usr/bin/env bash
22
LOG_FILE="/tmp/discourse-debug.txt"
33
WORKING_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
4+
app_name="$1"
45

56
log() {
67
if [ "$1" == "-e" ]
@@ -237,8 +238,12 @@ check_email() {
237238
}
238239

239240
get_yml_file() {
240-
app_name=""
241-
if [ -f containers/app.yml ]
241+
if [ -n "$app_name" ] && [ -f "containers/$app_name.yml" ]
242+
then
243+
log "Using app name '$app_name' from command argument"
244+
web_file="containers/$app_name.yml"
245+
log "Found $web_file"
246+
elif [ -f containers/app.yml ]
242247
then
243248
app_name="app"
244249
web_file=containers/$app_name.yml

0 commit comments

Comments
 (0)