File size: 643 Bytes
70b2a71
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/usr/bin/env bash
set -euo pipefail
SPACE="raymuz/NLLUniversalProfessionalEditor"
if ! command -v git >/dev/null; then echo "git is required"; exit 1; fi
if [ -z "${HF_TOKEN:-}" ]; then echo "Set HF_TOKEN to a write token."; exit 1; fi
REPO_URL="https://oauth2:${HF_TOKEN}@huggingface.co/spaces/${SPACE}"
TMP="$(mktemp -d)"
git clone "$REPO_URL" "$TMP/space"
find "$TMP/space" -mindepth 1 -maxdepth 1 ! -name .git -exec rm -rf {} +
cp -a . "$TMP/space/source"
cp -a "$TMP/space/source/." "$TMP/space/"
rm -rf "$TMP/space/source"
cd "$TMP/space"
git add .
git commit -m "Deploy NLL Universal Professional Editor" || true
git push origin main