mirror of
https://github.com/andwati/dokploy.git
synced 2026-11-23 12:18:46 +00:00
refactor: simplify execAsync options type for better clarity
- Updated the options parameter in execAsync to a more streamlined type, focusing on cwd, env, and shell properties for improved clarity and usability.
This commit is contained in:
@@ -1,5 +1,4 @@
|
|||||||
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";
|
||||||
@@ -12,7 +11,7 @@ const execAsyncBase = util.promisify(exec);
|
|||||||
|
|
||||||
export const execAsync = async (
|
export const execAsync = async (
|
||||||
command: string,
|
command: string,
|
||||||
options?: ObjectEncodingOptions & ExecOptions,
|
options?: { cwd?: string; env?: NodeJS.ProcessEnv; shell?: string },
|
||||||
): 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