mirror of
https://github.com/Dokploy/dokploy.git
synced 2026-07-21 05:45:23 +02:00
refactor: update execAsync options type for improved flexibility
- Enhanced the options parameter in execAsync to accept ObjectEncodingOptions and ExecOptions, allowing for more versatile command execution configurations.
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
import { exec, execFile } from "node:child_process";
|
import { exec, execFile } from "node:child_process";
|
||||||
|
import type { ObjectEncodingOptions } from "node:fs";
|
||||||
import util from "node:util";
|
import util from "node:util";
|
||||||
import { findServerById } from "@dokploy/server/services/server";
|
import { findServerById } from "@dokploy/server/services/server";
|
||||||
import { Client } from "ssh2";
|
import { Client } from "ssh2";
|
||||||
@@ -11,7 +12,7 @@ const execAsyncBase = util.promisify(exec);
|
|||||||
|
|
||||||
export const execAsync = async (
|
export const execAsync = async (
|
||||||
command: string,
|
command: string,
|
||||||
options?: { cwd?: string; env?: NodeJS.ProcessEnv },
|
options?: ObjectEncodingOptions & ExecOptions,
|
||||||
): Promise<{ stdout: string; stderr: string }> => {
|
): Promise<{ stdout: string; stderr: string }> => {
|
||||||
try {
|
try {
|
||||||
const result = await execAsyncBase(command, options);
|
const result = await execAsyncBase(command, options);
|
||||||
|
|||||||
Reference in New Issue
Block a user