Spaces:
Runtime error
Runtime error
Update ftp-upload.js
Browse files- ftp-upload.js +2 -21
ftp-upload.js
CHANGED
@@ -1,24 +1,5 @@
|
|
|
|
1 |
const { execSync } = require("child_process");
|
2 |
const path = require("path");
|
3 |
-
|
4 |
-
const token = process.env["sc4sc_token"];
|
5 |
-
if (!token) {
|
6 |
-
console.error("環境変数 'sc4sc_token' が設定されていません。");
|
7 |
-
process.exit(1);
|
8 |
-
}
|
9 |
-
|
10 |
const repoPath = path.join(__dirname, "dist");
|
11 |
-
|
12 |
-
console.log("接続完了!...");
|
13 |
-
try {
|
14 |
-
console.log("Git リポジトリを初期化...");
|
15 |
-
execSync("git init", { cwd: repoPath, shell: true });
|
16 |
-
execSync(`git remote add origin ${remoteUrl}`, { cwd: repoPath, shell: true });
|
17 |
-
execSync("git add .", { cwd: repoPath, shell: true });
|
18 |
-
execSync('git commit -m "Automated deploy"', { cwd: repoPath, shell: true });
|
19 |
-
execSync("git push -f origin master", { cwd: repoPath, shell: true });
|
20 |
-
|
21 |
-
console.log("✅ アップロードが完了しました!");
|
22 |
-
} catch (err) {
|
23 |
-
console.error("❌ アップロードに失敗しました:", err.message);
|
24 |
-
}
|
|
|
1 |
+
console.log("uploadddddding")
|
2 |
const { execSync } = require("child_process");
|
3 |
const path = require("path");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
const repoPath = path.join(__dirname, "dist");
|
5 |
+
execSync("upload.sh", { cwd: repoPath, shell: true });
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|