diff --git a/Source/Class/TypeScriptESBuild.ts b/Source/Class/TypeScriptESBuild.ts index 5436a969..e454e6f2 100644 --- a/Source/Class/TypeScriptESBuild.ts +++ b/Source/Class/TypeScriptESBuild.ts @@ -9,7 +9,7 @@ export default new (await import("commander")).Command() .version(process.env["VERSION_PACKAGE"] ?? "0.0.1") .description("🌀 Build TypeScript.") .argument("", "Build File.") - .option("-es, --ESBuild ", "ESBuild Configuration.") - .option("-ts, --TypeScript ", "TypeScript Configuration.") + .option("-ES, --ESBuild ", "ESBuild Configuration.") + .option("-TS, --TypeScript ", "TypeScript Configuration.") .action((await import("../Function/Build.js")).default) .parse(); diff --git a/Source/Function/Exec.ts b/Source/Function/Exec.ts index 932c4e4e..8f53f412 100644 --- a/Source/Function/Exec.ts +++ b/Source/Function/Exec.ts @@ -6,10 +6,13 @@ export default (async ( ...[Command, Echo = (Return) => console.log(Return)]: Parameters ) => { try { - const { stdout } = (await import("child_process")).exec(Command); + const { stdout, stderr } = (await import("child_process")).exec( + Command, + ); if (typeof Echo === "function") { stdout?.on("data", (Data) => Echo(Data)); + stderr?.on("data", (Data) => Echo(Data)); } } catch (_Error) { console.log(_Error); diff --git a/Source/Interface/Exec.ts b/Source/Interface/Exec.ts index 4aa5b30a..ff2ec1bf 100644 --- a/Source/Interface/Exec.ts +++ b/Source/Interface/Exec.ts @@ -5,16 +5,16 @@ export default interface Type { /** * The 'Exec' function is an asynchronous function that executes a command and logs the - * stdout of the child process. + * stdout and stderr of the child process. * * @param Command - The 'Command' parameter is a string that represents the * command you want to execute. It can be any valid command that can be executed in a * terminal or command prompt. * - * @param Echo - An optional parameter that controls whether the stdout + * @param Echo - An optional parameter that controls whether the stdout and stderr * of the child process should be logged. If set to 'false', no logging will occur. If set - * to a function, the function will be called with the stdout data as a parameter for custom - * logging. If not provided, stdout will be logged to the console by default. + * to a function, the function will be called with the stdout and stderr data as a parameter for custom + * logging. If not provided, stdout and stderr will be logged to the console by default. * */ ( diff --git a/Target/Function/Exec.js b/Target/Function/Exec.js index 13605e94..08c0c809 100644 --- a/Target/Function/Exec.js +++ b/Target/Function/Exec.js @@ -1 +1 @@ -var r=async(...[o,t=e=>console.log(e)])=>{try{const{stdout:e}=(await import("child_process")).exec(o);typeof t=="function"&&e?.on("data",a=>t(a))}catch(e){console.log(e)}};export{r as default}; +var s=async(...[a,t=e=>console.log(e)])=>{try{const{stdout:e,stderr:r}=(await import("child_process")).exec(a);typeof t=="function"&&(e?.on("data",o=>t(o)),r?.on("data",o=>t(o)))}catch(e){console.log(e)}};export{s as default}; diff --git a/Target/Interface/Exec.d.ts b/Target/Interface/Exec.d.ts index 86972ab1..cb1e3244 100644 --- a/Target/Interface/Exec.d.ts +++ b/Target/Interface/Exec.d.ts @@ -5,16 +5,16 @@ export default interface Type { /** * The 'Exec' function is an asynchronous function that executes a command and logs the - * stdout of the child process. + * stdout and stderr of the child process. * * @param Command - The 'Command' parameter is a string that represents the * command you want to execute. It can be any valid command that can be executed in a * terminal or command prompt. * - * @param Echo - An optional parameter that controls whether the stdout + * @param Echo - An optional parameter that controls whether the stdout and stderr * of the child process should be logged. If set to 'false', no logging will occur. If set - * to a function, the function will be called with the stdout data as a parameter for custom - * logging. If not provided, stdout will be logged to the console by default. + * to a function, the function will be called with the stdout and stderr data as a parameter for custom + * logging. If not provided, stdout and stderr will be logged to the console by default. * */ (Command: string, Echo?: false | ((Return: any) => void)): Promise;