From 49f47ce3747fa707d0eebc9f4963a381b7fb0d6d Mon Sep 17 00:00:00 2001 From: chrisEff Date: Thu, 25 Feb 2021 19:04:04 +0100 Subject: [PATCH] fixed usage of date command to work on macOS --- scripts/create-space-invader.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/create-space-invader.sh b/scripts/create-space-invader.sh index 0bc0b76..87c28ab 100755 --- a/scripts/create-space-invader.sh +++ b/scripts/create-space-invader.sh @@ -16,7 +16,7 @@ function print_banner() { if [ "$#" -lt 1 ]; then print_banner - echo -e "\nUse: $0 'MM/DD/YYYY'\n\nNote: The date must be a Sunday" + echo -e "\nUse: $0 'YYYY-MM-DD'\n\nNote: The date must be a Sunday" exit fi @@ -42,7 +42,7 @@ do echo "Commit for index: $index" >> commits.log git add commits.log git commit -m "Message for index $index" - git commit --amend --no-edit --date="$(date --date="$INITIAL_DATE + $index day" -R)" + git commit --amend --no-edit --date="$(date -v+${index}d -jf "%Y-%m-%d" "$INITIAL_DATE" +"%Y-%m-%d 00:00:00")" fi done echo -e "\nDone!! Ready to push!!"