Skip to content

Commit 0512d48

Browse files
committed
fix: wrap 'if' in parentheses for OS compatibility
1 parent 55ea798 commit 0512d48

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

gh-notify

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,15 +205,16 @@ get_notifs() {
205205
def colored(text; color):
206206
colors[color] + text + colors.reset;
207207
.[] | {
208+
# The "if" needs to be wrapped in parentheses, otherwise it will fail on some OSs
208209
updated_short:
209210
# for some reason ".updated_at" can be null
210-
if .updated_at then
211+
(if .updated_at then
211212
.updated_at | fromdateiso8601 | strftime("%Y-%m")
212213
else
213214
# Github Discussion launched in 2020
214215
# https://resources.github.com/devops/process/planning/discussions/
215216
"2020"
216-
end,
217+
end),
217218
# UTC time ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ
218219
# https://docs.github.com/en/rest/overview/resources-in-the-rest-api#timezones
219220
iso8601: now | strftime("%Y-%m-%dT%H:%M:%SZ"),

0 commit comments

Comments
 (0)