From e5323d2232b5b24d7481c5175777f15e9b2e68cd Mon Sep 17 00:00:00 2001 From: Sam James Date: Tue, 1 Nov 2022 22:44:27 +0000 Subject: keyrings-export.bash: use "last monday" / fix timestamped files generation Don't generate the timestamped files on Mondays to avoid "last" / "next" Monday confusion We want to avoid generating stuff like all-devs-20221107.gpg. Signed-off-by: Sam James --- keyrings-export.bash | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/keyrings-export.bash b/keyrings-export.bash index 35c9959..b3234e2 100755 --- a/keyrings-export.bash +++ b/keyrings-export.bash @@ -51,7 +51,12 @@ for key in service-keys committing-devs active-devs infra-devs retired-devs all- ln -s "${OUTPUT_DIR}"/keys/${key}.gpg "${OUTPUT_DIR}"/${key}.gpg fi - timestamp=$(date -u +%Y%m%d-%A -d "monday") + if [[ $(date -u +%A) == Monday ]] ; then + # We don't want to run on Mondays to avoid last/next week confusion + break + fi + + timestamp=$(date -u +%Y%m%d-%A -d "last monday") if [[ ${timestamp} != *-Monday ]] ; then break -- cgit v1.2.3-65-gdbad