npryce / adr-tools

Command-line tools for working with Architecture Decision Records
Other
4.64k stars 588 forks source link

Allow packaging and distribution projects to easily configure data and binary directories #2

Closed npryce closed 8 years ago

npryce commented 8 years ago

See issue #1 for an example why this is needed.

Current thoughts:

Have a config.sh file that is sourced at the top of every script, and defines location of files.

E.g.:

#!/bin/bash
set -e
source $(dirname $0)/config.sh

...

And config.sh would define shell variables (not environment variables). The default would be:

adr_bin_dir="$(dirname $0)"
adr_template_dir="$adr_bin_dir"

Packaging scripts could replace the entire file. E.g.

adr_prefix=/usr/local
adr_bin_dir=$adr_prefix/bin
adr_template_dir=$adr_prefix/share/adr-tools/templates

Comments from packaging experts welcome.

npryce commented 8 years ago

Implemented in master