-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathScript.sh
More file actions
34 lines (27 loc) · 859 Bytes
/
Script.sh
File metadata and controls
34 lines (27 loc) · 859 Bytes
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
#!/bin/bash
# beyond-guestbook.sh
# A script to automate Beyond Guestbook commits
REPO_DIR="$HOME/beyond-guestbook" # adjust this to your repo path
FILE="$REPO_DIR/thoughts.txt"
cd "$REPO_DIR" || exit 1
while true; do
echo "🌌 Beyond Guestbook"
echo "Enter your Name (GitHub username works best):"
read NAME
echo "Enter your Thought:"
read THOUGHT
# Append entry
echo "$NAME | $THOUGHT" >> "$FILE"
# Configure commit with this user's GitHub identity
git config user.name "$NAME"
echo "Enter your GitHub email (linked to commits):"
read EMAIL
git config user.email "$EMAIL"
# Commit & push
git add "$FILE"
git commit -m "$NAME | $THOUGHT"
git push origin main
echo "✅ Commit pushed as $NAME <$EMAIL>!"
echo "Press [Ctrl+C] to exit or wait for next entry..."
echo ""
done