Skip to content

Commit

Permalink
support another template location
Browse files Browse the repository at this point in the history
  • Loading branch information
snisnisniksonah committed Feb 5, 2018
1 parent 7957d30 commit 96d825f
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions src/adr-new
Original file line number Diff line number Diff line change
Expand Up @@ -77,16 +77,21 @@ template_type=$("$adr_bin_dir/_adr_type")
template="$ADR_TEMPLATE"
if [ -z $template ]
then
template="$dstdir/templates/template.md"
if [ ! -f "$template" ]
if [ -d "$dstdir/templates" ]
then
if [ -z $template_type ]
template="$dstdir/templates/template.md"
else
template="$dstdir/template.md"
fi
if [ ! -f "$template" ]
then
template="$adr_template_dir/template.md"
else
template="$adr_template_dir/template-$template_type.md"
if [ -z $template_type ]
then
template="$adr_template_dir/template.md"
else
template="$adr_template_dir/template-$template_type.md"
fi
fi
fi
fi

title="$@"
Expand Down

0 comments on commit 96d825f

Please sign in to comment.