chore: initial transfer commit

This commit is contained in:
Severian
2025-01-19 21:47:26 +08:00
commit 01edd57296
31 changed files with 4176 additions and 0 deletions

21
sucker.js Normal file
View File

@@ -0,0 +1,21 @@
#!/usr/bin/env node
const { execSync } = require("child_process");
// 1. Grab the port from the '-p' argument
const portIndex = process.argv.indexOf("-p");
let port = "3000";
if (portIndex !== -1 && portIndex + 1 < process.argv.length) {
port = process.argv[portIndex + 1];
}
// 2. Start Next.js using that port
try {
// Either pass it directly to next, e.g.:
// execSync(`npx next start -p ${port}`, { stdio: "inherit" });
//
// Or set the PORT env var and run your npm script:
execSync(`PORT=${port} npm run start`, { stdio: "inherit" });
} catch (err) {
console.error("Failed to start Next.js:", err);
process.exit(1);
}