File size: 871 Bytes
d5f068b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/**
 * Shared execution utilities
 *
 * Common helpers for spawning child processes with the correct environment.
 * Used by both route handlers and service layers.
 */
import { createLogger } from '@automaker/utils';
const logger = createLogger('ExecUtils');
// Extended PATH to include common tool installation locations
export const extendedPath = [
    process.env.PATH,
    '/opt/homebrew/bin',
    '/usr/local/bin',
    '/home/linuxbrew/.linuxbrew/bin',
    `${process.env.HOME}/.local/bin`,
]
    .filter(Boolean)
    .join(':');
export const execEnv = {
    ...process.env,
    PATH: extendedPath,
};
export function getErrorMessage(error) {
    if (error instanceof Error) {
        return error.message;
    }
    return String(error);
}
export function logError(error, context) {
    logger.error(`${context}:`, error);
}
//# sourceMappingURL=exec-utils.js.map