MCPcopy Create free account
hub / github.com/pingdotgg/t3code / projectScriptRuntimeEnv

Function projectScriptRuntimeEnv

packages/shared/src/projectScripts.ts:20–33  ·  view source on GitHub ↗
(
  input: ProjectScriptRuntimeEnvInput,
)

Source from the content-addressed store, hash-verified

18}
19
20export function projectScriptRuntimeEnv(
21 input: ProjectScriptRuntimeEnvInput,
22): Record<string, string> {
23 const env: Record<string, string> = {
24 T3CODE_PROJECT_ROOT: input.project.cwd,
25 };
26 if (input.worktreePath) {
27 env.T3CODE_WORKTREE_PATH = input.worktreePath;
28 }
29 if (input.extraEnv) {
30 return { ...env, ...input.extraEnv };
31 }
32 return env;
33}
34
35export function setupProjectScript(scripts: readonly ProjectScript[]): ProjectScript | null {
36 return scripts.find((script) => script.runOnWorktreeCreate) ?? null;

Callers 5

ChatView.tsxFile · 0.90
ChatViewContentFunction · 0.90
ThreadRouteScreenFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected