Skip to content

Commit

Permalink
Add help about the ADR_TEMPLATE environment variable
Browse files Browse the repository at this point in the history
  • Loading branch information
esumerfield authored and halostatue committed Jul 19, 2024
1 parent 01c2de2 commit d36ba4e
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 2 deletions.
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,15 @@ when you initialise the ADR log.
superseded by the new ADR. It then opens the new ADR in your
editor of choice.

3. Configure the template.

If the ADR directory contains a file `templates/template.md`, this is used
as the template for the new ADR. Otherwise a default template is used.
as the template for the new ADR. Otherwise a default template is used or one
found with $ADR_TEMPLATE.

export ADR_TEMPLATE=<path to file>

3. For further information, use the built in help:
4. For further information, use the built in help:

adr help

Expand Down
16 changes: 16 additions & 0 deletions src/_adr_help_config
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash
set -e
eval "$($(dirname $0)/adr-config)"

cat <<ENDHELP
usage: adr config
Displays the current configuration.
The adr_template_dir parameter defaults to the adr installation
but can be overwriten if a custom template is required by settting the
ADR_TEMPLATE environment variable to the custom file.
export ADR_TEMPLATE=<adr template file>
ENDHELP
4 changes: 4 additions & 0 deletions src/adr-config
Original file line number Diff line number Diff line change
Expand Up @@ -58,5 +58,9 @@ then
source "$("${adr_bin_dir}/_adr_dir")/.adr-config"
fi

if [[ -n $ADR_TEMPLATE ]]; then
adr_template_dir="$(dirname $ADR_TEMPLATE)"
fi

echo 'adr_bin_dir="'"${adr_bin_dir}"'"'
echo 'adr_template_dir="'"${adr_template_dir}"'"'

0 comments on commit d36ba4e

Please sign in to comment.