#!/bin/bash # Push VAMGUARD_TITAN to HuggingFace repository set -e echo "================================================" echo "📤 Pushing to HuggingFace: DJ-Goanna-Coding" echo "================================================" echo "" # Check if HF_TOKEN is set if [ -z "$HF_TOKEN" ]; then echo "⚠️ HF_TOKEN environment variable not set" echo " Please set your HuggingFace token:" echo " export HF_TOKEN='your_token_here'" exit 1 fi echo "✅ HF_TOKEN found" echo "" # Get repository info REPO_NAME="VAMGUARD_TITAN" HF_USERNAME="DJ-Goanna-Coding" HF_SPACE_NAME="TIA-ARCHITECT-CORE" echo "📋 Repository Information:" echo " GitHub Repo: DJ-Goana-Coding/$REPO_NAME" echo " HF Username: $HF_USERNAME" echo " HF Space: $HF_SPACE_NAME" echo "" # Check if we're in a git repository if [ ! -d .git ]; then echo "❌ Not in a git repository" exit 1 fi echo "✅ Git repository detected" echo "" # Add HuggingFace remote if it doesn't exist HF_REMOTE_URL="https://huggingface.co/spaces/$HF_USERNAME/$HF_SPACE_NAME" if git remote get-url huggingface 2>/dev/null; then echo "📡 HuggingFace remote already exists" git remote set-url huggingface "$HF_REMOTE_URL" else echo "📡 Adding HuggingFace remote" git remote add huggingface "$HF_REMOTE_URL" fi echo " Remote URL: $HF_REMOTE_URL" echo "" # Get current branch CURRENT_BRANCH=$(git branch --show-current) echo "🌿 Current branch: $CURRENT_BRANCH" echo "" # Show what will be pushed echo "📊 Files to be pushed:" git ls-files | head -20 echo " ... and more" echo "" # Confirm push read -p "🚀 Push to HuggingFace? (y/N): " -n 1 -r echo "" if [[ ! $REPLY =~ ^[Yy]$ ]]; then echo "❌ Push cancelled" exit 0 fi echo "" echo "🚀 Pushing to HuggingFace..." echo "" # Configure git to use token git config --local credential.helper store # Push to HuggingFace git push huggingface $CURRENT_BRANCH:main --force echo "" echo "================================================" echo "✅ Successfully pushed to HuggingFace!" echo "================================================" echo "" echo "🌐 View your space at:" echo " https://huggingface.co/spaces/$HF_USERNAME/$HF_SPACE_NAME" echo "" echo "📝 Note: It may take a few minutes for HuggingFace to rebuild your space" echo ""