Pay-then-profile join desk with live card, S3 upload fallback, hydration-safe drafts; document on test9 README. Co-authored-by: Cursor <cursoragent@cursor.com>
50 lines
1.3 KiB
JavaScript
50 lines
1.3 KiB
JavaScript
#!/usr/bin/env node
|
|
/**
|
|
* Shallow-clone Cal.com into apps/coffee/upstream/ for secondary development.
|
|
* Does not commit upstream into git.
|
|
*/
|
|
import { spawnSync } from "node:child_process";
|
|
import { existsSync, mkdirSync, rmSync } from "node:fs";
|
|
import { dirname, join } from "node:path";
|
|
import { fileURLToPath } from "node:url";
|
|
|
|
const root = join(dirname(fileURLToPath(import.meta.url)), "..");
|
|
const upstream = join(root, "upstream");
|
|
|
|
const REPOS = [
|
|
{
|
|
name: "cal.com",
|
|
url: "https://github.com/calcom/cal.com.git",
|
|
branch: "main",
|
|
},
|
|
];
|
|
|
|
mkdirSync(upstream, { recursive: true });
|
|
|
|
function run(cmd, args) {
|
|
console.log(`$ ${cmd} ${args.join(" ")}`);
|
|
const r = spawnSync(cmd, args, { stdio: "inherit", shell: false });
|
|
if (r.status !== 0) process.exit(r.status || 1);
|
|
}
|
|
|
|
for (const repo of REPOS) {
|
|
const dest = join(upstream, repo.name);
|
|
if (existsSync(join(dest, ".git"))) {
|
|
console.log(`[skip] ${repo.name} already cloned — pull --ff-only`);
|
|
run("git", ["-C", dest, "pull", "--ff-only", "origin", repo.branch]);
|
|
continue;
|
|
}
|
|
if (existsSync(dest)) rmSync(dest, { recursive: true, force: true });
|
|
run("git", [
|
|
"clone",
|
|
"--depth",
|
|
"1",
|
|
"--branch",
|
|
repo.branch,
|
|
repo.url,
|
|
dest,
|
|
]);
|
|
}
|
|
|
|
console.log("DONE fetch-upstream →", upstream);
|