summaryrefslogtreecommitdiff
path: root/secrets
diff options
context:
space:
mode:
authorIgor Soarez <igor@soarez.org>2026-11-18 17:36:33 +0000
committerIgor Soarez <igor@soarez.org>2026-11-18 17:36:33 +0000
commit6f953f98e83c0d1d533f1e7231376d0e459d1591 (patch)
tree35d9433828141ae92ed06f5c1d143a8d4cc08686 /secrets
parent9249082857d407dde4e22e672b615631a294279e (diff)
szecret check: a bucket named on the command line is checked once
Diffstat (limited to 'secrets')
-rwxr-xr-xsecrets/check.sh5
1 files changed, 4 insertions, 1 deletions
diff --git a/secrets/check.sh b/secrets/check.sh
index 299344b..fac3412 100755
--- a/secrets/check.sh
+++ b/secrets/check.sh
@@ -34,14 +34,17 @@ while [[ $# -gt 0 ]]; do
case "$1" in
--all) all=1 ;;
-*) die "usage: szecret check [--all] [<directory>...]" ;;
- *) dirs+=("${1%/}") ;;
+ *) dirs+=("$(cd "${1%/}" 2>/dev/null && pwd -P || echo "${1%/}")") ;;
esac
shift
done
+named=" ${dirs[*]+"${dirs[*]}"} "
if [[ -n "${buckets}" ]]; then
for d in "${buckets}"/*/; do
d="${d%/}"
+ # Named on the command line already: checked once.
+ [[ "${named}" != *" $(cd "${d}" && pwd -P) "* ]] || continue
if [[ -d "${d}" ]] && { [[ -n "${all}" ]] || is_reader "${d}"; }; then
dirs+=("${d}")
fi