-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtask.sh
More file actions
executable file
·37 lines (30 loc) · 1.41 KB
/
task.sh
File metadata and controls
executable file
·37 lines (30 loc) · 1.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/bash
# Define an array of messages
messages[0]="🐞 Fixed a sneaky bug"
messages[1]="🥶 Implemented cool feature"
messages[2]="🧹 Cleaned up codebase"
messages[3]="🧈 Merged code buttery smooth"
messages[4]="🐆 Performance optimized like cheetah"
messages[5]="🌱 Code's minty fresh"
messages[6]="📄 Updated docs as reading matters"
messages[7]="🔧 Fixed the thing, again"
messages[8]="✨ Made it work, magically"
# Generate a random number to select a message from the array
randomNum=$(($RANDOM % ${#messages[@]}))
# Get the current date and time
currentTimestamp=$(date '+%B %d, %Y at %I:%M %p')
# Check if update.md exists, and create it if it doesn't
if [ ! -e "update.md" ]; then
touch update.md
git add update.md
fi
# Append text to update.md, indicating the last update time
echo "## 🤔 LAST UPDATED ON: ${currentTimestamp}" >update.md
# Configure local Git user information
git config --local user.email "73966883+zhafranzainal@users.noreply.github.com"
git config --local user.name "Zhafran Zainal"
# Commit changes to the repository with a random message and the current timestamp
# git commit -am: commit all modified files and provide a commit message in a single command
# a (all): Automatically add all modified files in the working directory
# m (message): Specify the commit message that describes the purpose of the commit
git commit -am "${messages[$randomNum]} on ${currentTimestamp}"