From d51aceae1733b85c58cedb972e65d74221d5bacd Mon Sep 17 00:00:00 2001 From: Benjamin Wuethrich <8521043+bewuethr@users.noreply.github.com> Date: Sat, 24 Sep 2022 14:32:37 -0400 Subject: [PATCH] Add current time if no last message found --- scripts/slacktenure | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/slacktenure b/scripts/slacktenure index 8ab4411..1ae59d7 100755 --- a/scripts/slacktenure +++ b/scripts/slacktenure @@ -191,7 +191,10 @@ tenureupdate() { if [[ $deleted == 'true' ]]; then # Newly alum, get last status='alum' - last=$(findlast "$id" | msg2timestamp) + if ! last=$(findlast "$id" | msg2timestamp); then + # Use "now" if no last message found + printf -v last '%(%s)T' -2 + fi fi ;;