namedCodebase

tcmts.cli.codebase.namedCodebase · #mabc5vll · term · runs on the server

uses node:path

The codebase TCM_CODEBASE names, for running tcm from elsewhere (paths given to it are the caller's). What tcm runs has it too (a tcm run from the codebase finds it), except tests, which work in directories of their own.

import path from "node:path";

export const namedCodebase: string | undefined = (() => {
  const dir = process.env.TCM_CODEBASE;
  return dir ? path.resolve(dir) : undefined;
})()

used by