openApart

tcmts.cli.codebase.openApart · #dgji4bwy · term · runs on the server

uses process

The codebase in root, exactly, on its own branch: neither TCM_CODEBASE nor this process's session branch (TCM_BRANCH) is its. For a codebase a command makes or serves beside the one it runs in.

import { Codebase } from "#codebase/tcmts/cli/codebase";

export function openApart(root: string): Codebase {
  const session = process.env.TCM_BRANCH;
  delete process.env.TCM_BRANCH;
  try {
    return Codebase.open(root);
  } finally {
    if (session !== undefined) process.env.TCM_BRANCH = session;
  }
}

uses

used by