s4s-editor / upload.sh
soiz1's picture
Update upload.sh
83af368 verified
raw
history blame
600 Bytes
#!/bin/bash
set -e
if [ -z "$sc4sc_token" ]; then
echo "Error: Environment variable sc4sc_token is not set."
exit 1
fi
# Gitが安全と認識するようにする(必要最低限の変更)
git config --global --add safe.directory /app
SPACE_REPO="sc4sc/editor"
GIT_URL="https://hf_$sc4sc_token@huggingface.co/spaces/$SPACE_REPO"
# Gitリポジトリが未初期化なら初期化
if [ ! -d ".git" ]; then
git init
git remote add origin "$GIT_URL"
fi
git add .
git commit -m "Automated update" || echo "Nothing to commit"
git push origin main
echo "✅ Space successfully updated."