diff --git a/.gitignore b/.gitignore index e8f77c2..3c18105 100644 --- a/.gitignore +++ b/.gitignore @@ -57,4 +57,6 @@ server.exe /src/modules/debug # uploaded files -/uploads \ No newline at end of file +/uploads + +/scripts/git-multipush.ts \ No newline at end of file diff --git a/package.json b/package.json index b574b52..d6488ba 100644 --- a/package.json +++ b/package.json @@ -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" }, diff --git a/scripts/git-multipush.example.ts b/scripts/git-multipush.example.ts new file mode 100644 index 0000000..594573d --- /dev/null +++ b/scripts/git-multipush.example.ts @@ -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.");