File size: 1,261 Bytes
0d27572
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/bin/bash
set -e

echo "===> Preparing PodCraft for HuggingFace Spaces <===="

# Check if repository is initialized
if [ ! -d ".git" ]; then
  echo "Initializing git repository..."
  git init
fi

# Set up Git LFS
echo "Setting up Git LFS..."
git lfs install
git lfs track "*.gif" "*.png" "*.jpg" "*.jpeg" "*.mp3" "*.mp4" "*.wav" "*.ogg"
git add .gitattributes

# Configure git if needed
if ! git remote | grep -q "origin"; then
  echo "Please enter your HuggingFace username:"
  read username
  git remote add origin "https://huggingface.co/spaces/$username/podcraft"
  echo "Remote added: https://huggingface.co/spaces/$username/podcraft"
fi

# Check for large files
echo "Checking for large files (>100MB)..."
find . -type f -size +100M | while read file; do
  echo "Warning: Large file detected: $file"
  echo "Consider removing or excluding it from git."
done

# Prepare for commit
echo "Adding files to git..."
git add .

# Commit changes
echo "Committing changes..."
git commit -m "Update PodCraft for HuggingFace Spaces"

# Push to HuggingFace
echo "Pushing to HuggingFace Spaces..."
echo "This may take a while depending on the size of your repository."
git push -u origin main

echo "Push completed! Check your HuggingFace Space for build progress."