diff options
| author | Igor Soarez <igor@soarez.org> | 2026-11-18 17:36:33 +0000 |
|---|---|---|
| committer | Igor Soarez <igor@soarez.org> | 2026-11-18 17:36:33 +0000 |
| commit | 6f953f98e83c0d1d533f1e7231376d0e459d1591 (patch) | |
| tree | 35d9433828141ae92ed06f5c1d143a8d4cc08686 | |
| parent | 9249082857d407dde4e22e672b615631a294279e (diff) | |
szecret check: a bucket named on the command line is checked once
| -rwxr-xr-x | secrets/check.sh | 5 |
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 |
