From 0fcafa6ca4737f4f067439db984d37caaee23caa Mon Sep 17 00:00:00 2001 From: LangLangBart <92653266+LangLangBart@users.noreply.github.com> Date: Wed, 31 Jul 2024 22:05:00 +0200 Subject: [PATCH] fix: wrap 'if' in parentheses for OS compatibility (#94) --- gh-notify | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gh-notify b/gh-notify index dfb78d8..222257e 100755 --- a/gh-notify +++ b/gh-notify @@ -205,15 +205,16 @@ get_notifs() { def colored(text; color): colors[color] + text + colors.reset; .[] | { + # The "if" needs to be wrapped in parentheses, otherwise it will fail on some OSs. updated_short: # for some reason ".updated_at" can be null - if .updated_at then + (if .updated_at then .updated_at | fromdateiso8601 | strftime("%Y-%m") else # Github Discussion launched in 2020 # https://resources.github.com/devops/process/planning/discussions/ "2020" - end, + end), # UTC time ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ # https://docs.github.com/en/rest/overview/resources-in-the-rest-api#timezones iso8601: now | strftime("%Y-%m-%dT%H:%M:%SZ"),