s4s-editor-beta / upload.sh
soiz1's picture
Update upload.sh
0b78390 verified
raw
history blame
780 Bytes
#!/bin/bash
set -e # エラーが起きたらスクリプトを止める
# 環境変数がセットされているかチェック
if [ -z "$sc4sc_token" ]; then
echo "Error: 環境変数 sc4sc_token が設定されていません。" >&2
exit 1
fi
# 一時ディレクトリで作業(または任意のパス)
WORK_DIR="./space_repo"
REPO_URL="https://${sc4sc_token}@huggingface.co/spaces/sc4sc/editor"
# 既存のディレクトリを削除して clone(安全のため確認を入れても可)
rm -rf "$WORK_DIR"
git clone "$REPO_URL" "$WORK_DIR"
# ファイルをコピー(your_folder は実際のパスに)
cp -r ./your_folder/* "$WORK_DIR"
# コミット & プッシュ
cd "$WORK_DIR"
git add .
git commit -m "Update Space contents"
git push origin main