mirror of
https://github.com/shishantbiswas/bknd.git
synced 2026-03-16 12:37:20 +00:00
init create cli, added node and partially cloudflare
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { execSync } from "node:child_process";
|
||||
import { readFile } from "node:fs/promises";
|
||||
import path from "node:path";
|
||||
import url from "node:url";
|
||||
@@ -38,3 +39,15 @@ export async function fileExists(filePath: string) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
export function exec(command: string, opts?: { silent?: boolean; env?: Record<string, string> }) {
|
||||
const stdio = opts?.silent ? "pipe" : "inherit";
|
||||
const output = execSync(command, {
|
||||
stdio: ["inherit", stdio, stdio],
|
||||
env: { ...process.env, ...opts?.env }
|
||||
});
|
||||
if (!opts?.silent) {
|
||||
return;
|
||||
}
|
||||
return output.toString();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user