Skip to content

Commit da45d34

Browse files
Nikola HristovNikola Hristov
Nikola Hristov
authored and
Nikola Hristov
committed
1 parent a677711 commit da45d34

File tree

1 file changed

+0
-22
lines changed

1 file changed

+0
-22
lines changed

Source/Function/Exec.ts

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +0,0 @@
1-
import type Interface from "../Interface/Exec.js";
2-
3-
/**
4-
* @module Exec
5-
*
6-
*/
7-
export default (async (
8-
...[Command, Echo = async (Return) => console.log(Return)]
9-
) => {
10-
try {
11-
const { stdout, stderr } = (await import("child_process")).exec(
12-
Command,
13-
);
14-
15-
if (typeof Echo === "function") {
16-
stdout?.on("data", async (Data) => await Echo(Data.trim()));
17-
stderr?.on("data", async (Data) => await Echo(Data.trim(), true));
18-
}
19-
} catch (_Error) {
20-
console.log(_Error);
21-
}
22-
}) satisfies Interface as Interface;

0 commit comments

Comments
 (0)