Files
ha-kiosk-dashboard/setup-git-repo.sh
2025-12-31 04:26:58 -08:00

81 lines
1.6 KiB
Bash

#!/bin/bash
# Setup git repository and push to Gitea
set -e
echo "Home Assistant Kiosk - Git Repository Setup"
echo "============================================"
echo ""
# Check if git is installed
if ! command -v git &> /dev/null; then
echo "Installing git..."
sudo apt-get update
sudo apt-get install -y git
fi
cd /home/kyle/scripts
# Initialize git if needed
if [ ! -d .git ]; then
echo "Initializing git repository..."
git init
git config user.name "kyle"
git config user.email "kyle@localhost"
fi
# Create .gitignore if it doesn't exist
if [ ! -f .gitignore ]; then
cat > .gitignore << 'EOF'
# Logs
*.log
/tmp/
# Backup files
*.backup
*~
# Python cache
__pycache__/
*.pyc
*.pyo
# OS files
.DS_Store
Thumbs.db
EOF
fi
# Add all files
echo "Adding files to git..."
git add -A
# Check if there are changes to commit
if git diff --staged --quiet; then
echo "No changes to commit."
else
echo "Committing changes..."
git commit -m "Home Assistant kiosk dashboard setup
- Dashboard YAML configurations with card-mod
- Browser Mod automation for auto-scrolling
- Display rotation and sleep disable scripts
- Home Assistant API query scripts
- Dashboard launcher scripts
- Setup guides and documentation"
fi
# Show status
echo ""
echo "Repository Status:"
echo "=================="
git status --short
echo ""
echo "To push to Gitea:"
echo " 1. Get your repository URL from: http://192.168.68.53:3000"
echo " 2. Run: git remote add origin <repository-url>"
echo " 3. Run: git push -u origin main"
echo ""
echo "Or provide the repository URL and I can add it for you."