From 50d5c34a1405b81ecc1e4a8ee7107340693a8e96 Mon Sep 17 00:00:00 2001 From: Ed Sumerfield Date: Thu, 19 Aug 2021 16:36:47 -0400 Subject: [PATCH] Add help about the ADR_TEMPLATE environment variable --- README.md | 7 +++++-- src/_adr_help_config | 16 ++++++++++++++++ src/adr-config | 7 ++++++- 3 files changed, 27 insertions(+), 3 deletions(-) create mode 100755 src/_adr_help_config diff --git a/README.md b/README.md index 3763a81..a2f14a7 100644 --- a/README.md +++ b/README.md @@ -42,12 +42,15 @@ when you initialise the ADR log. ADR 9, and changes the status of ADR 9 to indicate that it is superceded by the new ADR. It then opens the new ADR in your editor of choice. + +3. Configure the template. + + export ADR_TEMPLATE= -3. For further information, use the built in help: +4. For further information, use the built in help: adr help - See the [tests](tests/) for detailed examples. The decisions for this tool are recorded as [architecture decision records in the project repository](doc/adr/). diff --git a/src/_adr_help_config b/src/_adr_help_config new file mode 100755 index 0000000..e4fe8d1 --- /dev/null +++ b/src/_adr_help_config @@ -0,0 +1,16 @@ +#!/bin/bash +set -e +eval "$($(dirname $0)/adr-config)" + +cat < + +ENDHELP diff --git a/src/adr-config b/src/adr-config index 0168223..f83e33f 100755 --- a/src/adr-config +++ b/src/adr-config @@ -3,5 +3,10 @@ basedir=$(cd -L $(dirname $0) >/dev/null 2>&1 && pwd -L) +adr_template=$basedir +if [[ -n $ADR_TEMPLATE ]]; then + adr_template=`dirname $ADR_TEMPLATE` +fi + echo 'adr_bin_dir="'"${basedir}"'"' -echo 'adr_template_dir="'"${basedir}"'"' +echo 'adr_template_dir="'"${adr_template}"'"'