Initial commit - TrackSteel Site

This commit is contained in:
Marcos
2026-05-15 08:44:32 -03:00
commit 6555459af0
95 changed files with 13984 additions and 0 deletions
+80
View File
@@ -0,0 +1,80 @@
#!/bin/bash
# Script de sincronização automática com GitHub
# Uso: ./sync.sh [mensagem do commit]
echo "========================================"
echo " TrackSteel - Sync com GitHub"
echo "========================================"
echo
# Cores para output
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m' # No Color
# Função para exibir erro e sair
error_exit() {
echo -e "${RED}Erro: $1${NC}"
exit 1
}
# Função para exibir sucesso
success_msg() {
echo -e "${GREEN}$1${NC}"
}
# Função para exibir aviso
warning_msg() {
echo -e "${YELLOW}$1${NC}"
}
# Verifica se estamos em um repositório Git
if ! git rev-parse --git-dir > /dev/null 2>&1; then
error_exit "Este diretório não é um repositório Git"
fi
# Adiciona todos os arquivos
echo "Adicionando arquivos..."
git add .
if [ $? -ne 0 ]; then
error_exit "Falha ao adicionar arquivos"
fi
# Define mensagem do commit
if [ -z "$1" ]; then
commit_msg="Update: $(date '+%Y-%m-%d %H:%M:%S')"
else
commit_msg="$1"
fi
echo "Fazendo commit com mensagem: $commit_msg"
git commit -m "$commit_msg"
if [ $? -ne 0 ]; then
warning_msg "Nenhuma mudança para commitar ou erro no commit"
echo
echo "Status atual:"
git status
exit 0
fi
# Push para o repositório
echo "Enviando para GitHub..."
git push origin main
if [ $? -ne 0 ]; then
warning_msg "Erro ao fazer push. Tentando pull primeiro..."
git pull origin main --rebase
if [ $? -ne 0 ]; then
error_exit "Erro no pull. Resolva conflitos manualmente."
fi
echo "Tentando push novamente..."
git push origin main
if [ $? -ne 0 ]; then
error_exit "Erro no push após pull"
fi
fi
echo
success_msg "Sincronização concluída com sucesso!"
success_msg "Mudanças enviadas para: https://github.com/Reifonas/WebsiteTS.git"
echo