Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed usage of date command to work on macOS #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions scripts/create-space-invader.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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!!"
Expand Down