mirror of
https://github.com/johndoe6345789/metabuilder.git
synced 2026-05-03 18:24:53 +00:00
4db87be546
Co-authored-by: johndoe6345789 <224850594+johndoe6345789@users.noreply.github.com>
14 lines
504 B
TypeScript
14 lines
504 B
TypeScript
import { ASTLambdaRefactor } from './ast-lambda-refactor'
|
|
import * as fs from 'fs/promises'
|
|
import * as path from 'path'
|
|
import { exec } from 'child_process'
|
|
import { promisify } from 'util'
|
|
|
|
export async function runCommand(cmd: string, cwd: string = process.cwd()): Promise<{ stdout: string; stderr: string }> {
|
|
try {
|
|
return await execAsync(cmd, { cwd, maxBuffer: 10 * 1024 * 1024 })
|
|
} catch (error: any) {
|
|
return { stdout: error.stdout || '', stderr: error.stderr || error.message }
|
|
}
|
|
}
|