Skip to content

Commit d36ba4e

Browse files
esumerfieldhalostatue
authored andcommitted
Add help about the ADR_TEMPLATE environment variable
npryce#121
1 parent 01c2de2 commit d36ba4e

3 files changed

Lines changed: 27 additions & 2 deletions

File tree

README.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,15 @@ when you initialise the ADR log.
4141
superseded by the new ADR. It then opens the new ADR in your
4242
editor of choice.
4343

44+
3. Configure the template.
45+
4446
If the ADR directory contains a file `templates/template.md`, this is used
45-
as the template for the new ADR. Otherwise a default template is used.
47+
as the template for the new ADR. Otherwise a default template is used or one
48+
found with $ADR_TEMPLATE.
49+
50+
export ADR_TEMPLATE=<path to file>
4651

47-
3. For further information, use the built in help:
52+
4. For further information, use the built in help:
4853

4954
adr help
5055

src/_adr_help_config

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/bin/bash
2+
set -e
3+
eval "$($(dirname $0)/adr-config)"
4+
5+
cat <<ENDHELP
6+
usage: adr config
7+
8+
Displays the current configuration.
9+
10+
The adr_template_dir parameter defaults to the adr installation
11+
but can be overwriten if a custom template is required by settting the
12+
ADR_TEMPLATE environment variable to the custom file.
13+
14+
export ADR_TEMPLATE=<adr template file>
15+
16+
ENDHELP

src/adr-config

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,5 +58,9 @@ then
5858
source "$("${adr_bin_dir}/_adr_dir")/.adr-config"
5959
fi
6060

61+
if [[ -n $ADR_TEMPLATE ]]; then
62+
adr_template_dir="$(dirname $ADR_TEMPLATE)"
63+
fi
64+
6165
echo 'adr_bin_dir="'"${adr_bin_dir}"'"'
6266
echo 'adr_template_dir="'"${adr_template_dir}"'"'

0 commit comments

Comments
 (0)