Skip to content

Commit b681acc

Browse files
committed
Merge branch 'fix_error' into main
cc2a288 fixed error message `date: invalid date`
2 parents 7cc4936 + cc2a288 commit b681acc

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

activity.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ fi
2929
##
3030
for day in {1..365} ; do
3131
# Get the past date of the commit
32-
day=$(date --date="-${day} day")
32+
day2=$(date --date="-${day} day" "+%a, %d %b %Y %X %z")
3333

3434
echo "Creating commits for ${day}"
3535

@@ -39,10 +39,10 @@ for day in {1..365} ; do
3939
# Create the comits
4040
echo "Creating ${commits} commits"
4141
for ((i=1;i<=${commits};i++)); do
42-
content=$(date -d "$day" +"%s")
42+
content=$(date -d "${day2}" +"%s")
4343
echo ${content}-${i} >> .commits/changes
4444
git commit -am "Commit number ${content}-${i}" > /dev/null 2>&1
45-
git commit --amend --no-edit --date "${day}" > /dev/null 2>&1
45+
git commit --amend --no-edit --date "${day2}" > /dev/null 2>&1
4646
done
4747
done
4848

0 commit comments

Comments
 (0)