2026-05-16 22:03:14 +08:00
|
|
|
#!/usr/bin/env node
|
|
|
|
|
const { spawn } = require("child_process");
|
2026-05-18 17:01:35 +08:00
|
|
|
const fs = require("fs");
|
|
|
|
|
const path = require("path");
|
2026-05-16 22:03:14 +08:00
|
|
|
|
|
|
|
|
process.env.CONVEX_TMPDIR = "/mnt/Data1T/mnote/.convex-tmp";
|
|
|
|
|
|
|
|
|
|
const adminKey = "mnote-local|01cedce68c51e168c6aacb282a90f7d233f56eddfabb07944a1d9dd9506f73ba888fc7daff";
|
2026-05-18 17:01:35 +08:00
|
|
|
const repoRoot = "/mnt/Data1T/mnote";
|
|
|
|
|
const rootConvexDir = path.join(repoRoot, "convex");
|
|
|
|
|
const recycleConvexDir = path.join(repoRoot, "recycle", "wolai-frontend", "convex");
|
|
|
|
|
const rootHasFullSchema = fs.existsSync(path.join(rootConvexDir, "pages.ts"));
|
|
|
|
|
const deployCwd = rootHasFullSchema
|
|
|
|
|
? repoRoot
|
|
|
|
|
: path.dirname(recycleConvexDir);
|
2026-05-16 22:03:14 +08:00
|
|
|
|
|
|
|
|
const args = [
|
|
|
|
|
"deploy",
|
|
|
|
|
"--url", "http://127.0.0.1:3210", // Backend port, NOT HTTP actions (3211)
|
|
|
|
|
"--admin-key", adminKey,
|
|
|
|
|
"--typecheck", "disable",
|
|
|
|
|
"--codegen", "disable",
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
const child = spawn("npx", ["convex", ...args], {
|
2026-05-18 17:01:35 +08:00
|
|
|
cwd: deployCwd,
|
2026-05-16 22:03:14 +08:00
|
|
|
stdio: "inherit",
|
|
|
|
|
env: { ...process.env, CONVEX_TMPDIR: "/mnt/Data1T/mnote/.convex-tmp" },
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
child.on("close", (code) => {
|
|
|
|
|
process.exit(code || 0);
|
|
|
|
|
});
|