From 035489d23fcde24514298b3bdee7d52e711cd770 Mon Sep 17 00:00:00 2001 From: Harry Wixley Date: Sat, 23 Mar 2024 10:13:31 +0000 Subject: [PATCH] fix macintosh leap-year --- src/commands/leap-year.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/commands/leap-year.sh b/src/commands/leap-year.sh index 90023db..7569fca 100644 --- a/src/commands/leap-year.sh +++ b/src/commands/leap-year.sh @@ -1,7 +1,11 @@ #!/bin/bash date=$(date) -year="${date:24:29}" +if [[ sys.os.mac ]]; then + year="${date:24:30}" +else + year="${date:24:29}" +fi if [[ "$year" =~ ^[0-9]*00$ ]]; then if [ "$((year % 400))" -eq 0 ]; then