Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add help about the ADR_TEMPLATE environment variable #121

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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=<path to file>

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/).
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
7 changes: 6 additions & 1 deletion src/adr-config
Original file line number Diff line number Diff line change
Expand Up @@ -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}"'"'