s4s-editor-beta / upload.sh
soiz1's picture
Update upload.sh
4767521 verified
raw
history blame
710 Bytes
#!/bin/bash
set -e
if [ -z "$sc4sc_token" ]; then
echo "❌ Error: Environment variable sc4sc_token is not set."
exit 1
fi
# Install huggingface_hub CLI if needed
if ! command -v huggingface-cli &> /dev/null; then
echo "πŸ”§ Installing huggingface_hub CLI..."
pip install huggingface_hub[cli] --break-system-packages
fi
# Secure login: prevent token from appearing in logs
echo "πŸ” Logging into Hugging Face CLI..."
huggingface-cli login --token <<< "$sc4sc_token" > /dev/null
# Upload everything in current directory
echo "πŸ“€ Uploading to Hugging Face Space: sc4sc/editor"
huggingface-cli upload sc4sc/editor . --repo-type=space --include="*" --yes
echo "βœ… Upload completed successfully."