config

OpenBSD system configuration
git clone git://jacobedwards.org/config
Log | Files | Refs | README

commit b00b720b0d23cdcc978729b8ea254e740ce86d1e
parent a7ef0d7feeb4c01ce93ae272ac07afdc1b4ef2d9
Author: Jacob R. Edwards <n/a>
Date:   Sun,  4 Dec 2022 20:13:53 -0600

Improve tag script's tags finding logic

This new method produces the expected results when base is defined
but not tags; if base is defined, tags will be generated from it.
Only if base is undefined will a recursive search for a 'tags'
directory be used.

Diffstat:
Mlocal/bin/bin/tag | 9+++++++--
1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/local/bin/bin/tag b/local/bin/bin/tag @@ -87,8 +87,13 @@ test $# -eq 0 && if $auto then if ! test "$tags"; then - tags="$(findtags "$PWD")" || - error 'Unable to find tags directory' + if test "$base"; then + ! test -d "$base"/tags && + error "The 'tags' directory doesn't exist in base" + tags="$base"/tags + elif ! tags="$(findtags "$PWD")"; then + error 'Unable to find tags directory' + fi fi ! test "$base" && base="$(dirname "$tags")"