| 39 | const executorAvailable = (): boolean => app.isPackaged && existsSync(bundledExecutorPath()); |
| 40 | |
| 41 | const 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 | |
| 56 | const serviceEnv = async (dataDir: string): Promise<NodeJS.ProcessEnv> => ({ |
| 57 | ...process.env, |