git

tcmts.cli.mirror.git · #l2kkaqzs · term · runs on the server

uses node:child_process

import { spawnSync } from "node:child_process";

export const git = (dir: string, ...args: string[]) => {
  const r = spawnSync("git", ["-C", dir, ...args], { encoding: "utf8" });
  return r.status === 0 ? r.stdout.trim() : undefined;
}

used by