forked from npryce/adr-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow system, global and local config, similar to git configs
Viable config file paths are: * System * `/etc/default/adr-config` * `/etc/adr-config` * Global (user) * `~/.adr-config` * Local (repo) * `$(_adr_dir)/.adr-config` This change relies on `_adr_dir` not trying to load config, so it also incorporates this removal, even though this may have been removed in another branch/PR. Tests are included. If it's not possible to run sudo based tests in the CI/CD system, then these should be removed. npryce#105
- Loading branch information
1 parent
19ded91
commit 43aae6b
Showing
3 changed files
with
129 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
adr config | ||
# This script returns the configuration values for adr-tools. It does not change these values. | ||
adr_bin_dir="/home/spriggsj/adr-tools-cp/src" | ||
adr_template_dir="/home/spriggsj/adr-tools-cp/src" | ||
|
||
adr config -q | ||
adr_bin_dir="/home/spriggsj/adr-tools-cp/src" | ||
adr_template_dir="/home/spriggsj/adr-tools-cp/src" | ||
|
||
adr config -q | ||
adr_bin_dir="/home/spriggsj/adr-tools-cp/src" | ||
adr_template_dir="/usr/local/share/adr-tools" | ||
|
||
echo "adr_template_dir='/usr/local/share/adr-tools'" > ~/.adr-config | ||
adr config | ||
# This script returns the configuration values for adr-tools. It does not change these values. | ||
# Loading system values from /etc/adr-config | ||
# Loading global values from ~/.adr-config | ||
adr_bin_dir="/home/spriggsj/adr-tools-cp/src" | ||
adr_template_dir="/usr/local/share/adr-tools" | ||
|
||
adr config -q | ||
adr_bin_dir="/home/spriggsj/adr-tools-cp/src" | ||
adr_template_dir="/usr/local/share/adr-tools" | ||
|
||
mkdir -p doc/adr | ||
echo "adr_template_dir='/usr/local/share/adr-tools'" > doc/adr/.adr-config | ||
adr config | ||
# This script returns the configuration values for adr-tools. It does not change these values. | ||
# Loading system values from /etc/adr-config | ||
# Loading global values from ~/.adr-config | ||
# Loading local values from doc/adr/.adr-config | ||
adr_bin_dir="/home/spriggsj/adr-tools-cp/src" | ||
adr_template_dir="/usr/local/share/adr-tools" | ||
|
||
adr config -q | ||
adr_bin_dir="/home/spriggsj/adr-tools-cp/src" | ||
adr_template_dir="/usr/local/share/adr-tools" | ||
|
||
adr config -q | ||
adr_bin_dir="/home/spriggsj/adr-tools-cp/src" | ||
adr_template_dir="/usr/local/share/adr-tools" | ||
|
||
rm ~/.adr-config | ||
adr config | ||
# This script returns the configuration values for adr-tools. It does not change these values. | ||
# Loading local values from doc/adr/.adr-config | ||
adr_bin_dir="/home/spriggsj/adr-tools-cp/src" | ||
adr_template_dir="/usr/local/share/adr-tools" | ||
|
||
adr config -q | ||
adr_bin_dir="/home/spriggsj/adr-tools-cp/src" | ||
adr_template_dir="/usr/local/share/adr-tools" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
adr config | ||
|
||
adr config -q | ||
|
||
echo "adr_template_dir='/usr/local/share/adr-tools'" >~/.adr-config | ||
adr config | ||
|
||
adr config -q | ||
|
||
mkdir -p doc/adr | ||
echo "adr_template_dir='/usr/local/share/adr-tools'" >doc/adr/.adr-config | ||
adr config | ||
|
||
adr config -q | ||
|
||
rm ~/.adr-config | ||
adr config | ||
|
||
adr config -q |