From 42c58ec7666c32ae391729128e653383e7cd92d1 Mon Sep 17 00:00:00 2001 From: kyle Date: Wed, 31 Dec 2025 04:26:58 -0800 Subject: [PATCH] Add setup-git-repo.sh --- setup-git-repo.sh | 80 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 setup-git-repo.sh diff --git a/setup-git-repo.sh b/setup-git-repo.sh new file mode 100644 index 0000000..a2c0094 --- /dev/null +++ b/setup-git-repo.sh @@ -0,0 +1,80 @@ +#!/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 " +echo " 3. Run: git push -u origin main" +echo "" +echo "Or provide the repository URL and I can add it for you."