import {execSync, ExecSyncOptions} from 'child_process' import {als} from './context' /** * Executes a shell command using the current context's working directory. * Thread-safe for Probot. */ export const prixExec = ( command: string, options: ExecSyncOptions = {} ): string => { const context = als.getStore() const cwd = options.cwd || context?.workingDir || process.cwd() const result = execSync(command, { ...options, cwd, encoding: 'utf8' }) return result ? result.toString() : '' }