sessionDirFor

tcmts.cli.codebase.sessionDirFor · #h7g2xynh · term · runs on the server

uses node:path

Where a session (a process working on its own branch, TCM_BRANCH) keeps what's its own: its scratch files, and the #codebase shim they import its branch's names through.

import path from "node:path";

export function sessionDirFor(root: string, branch: string): string {
  return path.join(root, ".tcm", "sessions", branch.replace(/[^\w.-]/g, "_"));
}

used by