🔧 (git) add multi push repository

This commit is contained in:
unknown
2025-07-02 10:11:45 +07:00
parent 5465ba4e81
commit ee88b6f8b4
3 changed files with 17 additions and 1 deletions

2
.gitignore vendored
View File

@ -58,3 +58,5 @@ server.exe
# uploaded files
/uploads
/scripts/git-multipush.ts

View File

@ -8,6 +8,7 @@
"map": "madge --image structure.svg src/index.ts",
"lint": "bunx eslint",
"commit": "bun x git-cz",
"push": "bun scripts/git-multipush.ts",
"route:sync": "bun run ./scripts/sync-routes.ts",
"env:publish": "bun run ./scripts/create-example-env.ts"
},

View File

@ -0,0 +1,13 @@
import { execSync } from "child_process";
const remotes = ["origin"];
for (const remote of remotes) {
console.log(`Pushing to ${remote}...`);
try {
execSync(`git push ${remote} main`, { stdio: "inherit" });
} catch (err) {
console.error(`❌ Failed to push to ${remote}`);
}
}
console.log("✅ All remotes processed.");