docs(agent): add rules and skills
This commit is contained in:
31
.agent/skills/git-push/scripts/push_changes.sh
Executable file
31
.agent/skills/git-push/scripts/push_changes.sh
Executable file
@@ -0,0 +1,31 @@
|
||||
#!/bin/bash
|
||||
|
||||
# --- НАСТРОЙКИ (Проверь, чтобы совпадали с check_and_pull.sh) ---
|
||||
SERVER="root@192.168.1.87"
|
||||
REMOTE_PATH="/root/magistr/program"
|
||||
# -------------------------------------------------------------
|
||||
|
||||
COMMIT_MSG="$1"
|
||||
|
||||
# Проверка: если сообщение пустое, ругаемся
|
||||
if [ -z "$COMMIT_MSG" ]; then
|
||||
echo "❌ Error: Commit message is required."
|
||||
echo "Usage: ./push_changes.sh \"feat: description\""
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "🚀 Starting Push Sequence to $SERVER..."
|
||||
|
||||
# Выполняем цепочку команд на сервере одной строкой
|
||||
ssh -o BatchMode=yes "$SERVER" "export LANG=C.UTF-8 && cd $REMOTE_PATH && \
|
||||
git add . && \
|
||||
git commit -m \"$COMMIT_MSG\" && \
|
||||
git push origin main"
|
||||
|
||||
# Проверяем код возврата последней команды
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "✅ Success! Changes pushed to remote."
|
||||
else
|
||||
echo "❌ Failed to push. Check the output above for errors."
|
||||
exit 1
|
||||
fi
|
||||
Reference in New Issue
Block a user