MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / captureUserPath

Function captureUserPath

apps/desktop/src/main/service.ts:41–54  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

39const executorAvailable = (): boolean => app.isPackaged && existsSync(bundledExecutorPath());
40
41const captureUserPath = async (): Promise<string | undefined> => {
42 const shell = process.env.SHELL;
43 if (!shell) return process.env.PATH;
44 try {
45 const { stdout } = await execFileAsync(shell, ["-ilc", 'printf "%s" "$PATH"'], {
46 encoding: "utf8",
47 timeout: 5000,
48 });
49 const path = stdout.trim();
50 return path.length > 0 ? path : process.env.PATH;
51 } catch {
52 return process.env.PATH;
53 }
54};
55
56const serviceEnv = async (dataDir: string): Promise<NodeJS.ProcessEnv> => ({
57 ...process.env,

Callers 1

serviceEnvFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected