File size: 963 Bytes
e0675e2
eccbbd1
 
e0675e2
 
 
 
a4be0a3
 
e0675e2
 
 
 
 
4dfa268
 
 
 
 
 
e0675e2
 
 
 
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
const { execSync } = require("child_process");
const path = require("path");

const token = process.env["sc4sc_token"];
if (!token) {
  console.error("環境変数 'sc4sc_token' が設定されていません。");
  process.exit(1);
}

const repoPath = path.join(__dirname, "dist");
const remoteUrl = `https://user:${token}@huggingface.co/spaces/soiz1/simple-editor`;
console.log("接続完了!...");
try {
  console.log("Git リポジトリを初期化...");
execSync("git init", { cwd: repoPath, shell: true });
execSync(`git remote add origin ${remoteUrl}`, { cwd: repoPath, shell: true });
execSync("git add .", { cwd: repoPath, shell: true });
execSync('git commit -m "Automated deploy"', { cwd: repoPath, shell: true });
execSync("git push -f origin master", { cwd: repoPath, shell: true });

  console.log("✅ アップロードが完了しました!");
} catch (err) {
  console.error("❌ アップロードに失敗しました:", err.message);
}