mirror of
https://github.com/dokploy/dokploy.git
synced 2026-06-14 03:19:49 +00:00
Improve: Use consistent ExecOptions type and proper fallback for maxBuffer
Co-authored-by: Siumauricio <47042324+Siumauricio@users.noreply.github.com>
This commit is contained in:
@@ -15,12 +15,12 @@ const MAX_EXEC_BUFFER_SIZE = 100 * 1024 * 1024;
|
||||
|
||||
export const execAsync = async (
|
||||
command: string,
|
||||
options?: { cwd?: string; env?: NodeJS.ProcessEnv; shell?: string },
|
||||
options?: ExecOptions & { shell?: string },
|
||||
): Promise<{ stdout: string; stderr: string }> => {
|
||||
try {
|
||||
const result = await execAsyncBase(command, {
|
||||
...options,
|
||||
maxBuffer: MAX_EXEC_BUFFER_SIZE,
|
||||
maxBuffer: options?.maxBuffer ?? MAX_EXEC_BUFFER_SIZE,
|
||||
});
|
||||
return {
|
||||
stdout: result.stdout.toString(),
|
||||
@@ -64,7 +64,7 @@ export const execAsyncStream = (
|
||||
|
||||
const childProcess = exec(
|
||||
command,
|
||||
{ maxBuffer: MAX_EXEC_BUFFER_SIZE, ...options },
|
||||
{ ...options, maxBuffer: options?.maxBuffer ?? MAX_EXEC_BUFFER_SIZE },
|
||||
(error) => {
|
||||
if (error) {
|
||||
reject(
|
||||
|
||||
Reference in New Issue
Block a user