MCPcopy Index your code
hub / github.com/callstack/agent-device / buildSwiftToolEnv

Function buildSwiftToolEnv

src/utils/swift-cache.ts:13–24  ·  view source on GitHub ↗
(env: NodeJS.ProcessEnv = process.env)

Source from the content-addressed store, hash-verified

11const LOCK_RETRY_DELAY_MS = 25;
12
13export function buildSwiftToolEnv(env: NodeJS.ProcessEnv = process.env): NodeJS.ProcessEnv {
14 const root = getSwiftCacheRoot();
15 const homePath = path.join(root, 'home');
16 const moduleCachePath = path.join(root, 'module-cache');
17 fs.mkdirSync(homePath, { recursive: true });
18 fs.mkdirSync(moduleCachePath, { recursive: true });
19 return {
20 ...env,
21 HOME: homePath,
22 CLANG_MODULE_CACHE_PATH: moduleCachePath,
23 };
24}
25
26export async function compileSwiftSourceFile(params: {
27 sourcePath: string;

Callers 3

isPlayableVideoFunction · 0.90
exportProcessedVideoFunction · 0.90
ensureSwiftExecutableFunction · 0.85

Calls 1

getSwiftCacheRootFunction · 0.85

Tested by

no test coverage detected