forked from sundial-org/awesome-openclaw-skills
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsync.sh
More file actions
32 lines (26 loc) · 601 Bytes
/
Copy pathsync.sh
File metadata and controls
32 lines (26 loc) · 601 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
#!/bin/bash
# Usage: ./sync.sh ["Commit Message"]
MSG="${1:-Auto-sync: Routine evolution update}"
REPO_DIR="/home/crishaocredits/.openclaw/workspace"
cd "$REPO_DIR" || exit 1
# Check for changes
if [ -z "$(git status --porcelain)" ]; then
echo "Nothing to commit."
exit 0
fi
# Add everything
git add .
# Commit (pre-commit hook will run here)
if git commit -m "$MSG"; then
echo "Commit successful."
else
echo "Commit failed (possibly blocked by pre-commit hook or empty)."
exit 1
fi
# Push
if git push origin main; then
echo "Push successful."
else
echo "Push failed."
exit 1
fi