#!/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