commit 9a09d432e2844d73ce70cdba06906e45796bd710 parent 648a035123503a77bfc9399fa29ff5cbe8ac26e3 Author: dwrz <dwrz@dwrz.net> Date: Thu, 16 Nov 2023 17:30:34 +0000 Refactor uncommitted for input of warning minutes Diffstat:
M | scripts/uncommitted | | | 10 | +++++----- |
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/scripts/uncommitted b/scripts/uncommitted @@ -1,10 +1,5 @@ #!/usr/bin/env bash -# How many minutes to wait before displaying a warning. -readonly WARNING_MINUTES=15 - -readonly repos="$()" - check_repo() { local d="$1" @@ -36,6 +31,11 @@ check_repo() { } main() { + # How many minutes to wait before displaying a warning; default 15. + readonly WARNING_MINUTES="${1:-15}" + + >&2 echo "Checking uncommitted in the last ${WARNING_MINUTES} minutes." + pass repositories | while read -r d; do if ! [[ -d "$d" ]]; then err "$0: ${d} is not a directory"