File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -133,6 +133,7 @@ git semver [help]
133
133
134
134
Git-semver will check for a configuration file in the following locations (and use the one that exists):
135
135
136
+ - ` $GIT_REPO_ROOT/.git-semver `
136
137
- ` $XDG_CONFIG_HOME/.git-semver/config `
137
138
- ` $HOME/.git-semver/config `
138
139
Original file line number Diff line number Diff line change @@ -340,8 +340,15 @@ readonly DIR_HOME="${HOME}"
340
340
# (see http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html)
341
341
DIR_CONF=" ${XDG_CONFIG_HOME:- ${HOME} } /.git-semver"
342
342
343
+ # Set vars
344
+ DIR_ROOT=" $( git rev-parse --show-toplevel 2> /dev/null) "
345
+
343
346
# Set (and load) user config
344
- if [ -f " ${DIR_CONF} /config" ]
347
+ if [ -f " ${DIR_ROOT} /.git-semver" ]
348
+ then
349
+ FILE_CONF=" ${DIR_ROOT} /.git-semver"
350
+ source " ${FILE_CONF} "
351
+ elif [ -f " ${DIR_CONF} /config" ]
345
352
then
346
353
FILE_CONF=" ${DIR_CONF} /config"
347
354
# shellcheck source=config.example
351
358
FILE_CONF=" ${DIR_HOME} /.git-semver/config"
352
359
fi
353
360
354
- # Set vars
355
- DIR_ROOT=" $( git rev-parse --show-toplevel 2> /dev/null) "
356
-
357
361
GIT_HASH=" $( git rev-parse HEAD 2> /dev/null) "
358
362
GIT_BRANCH=" $( git rev-parse --abbrev-ref HEAD 2> /dev/null) "
359
363
You can’t perform that action at this time.
0 commit comments