File size: 600 Bytes
c8abb98
 
 
 
 
 
 
 
83af368
 
 
c8abb98
c92ce3d
c8abb98
83af368
c92ce3d
 
 
 
c8abb98
c92ce3d
 
 
c8abb98
c92ce3d
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
#!/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."