First upload version 0.0.1

This commit is contained in:
Neyra
2026-02-05 15:27:49 +08:00
commit 8e9b7201ed
4182 changed files with 593136 additions and 0 deletions

View File

@@ -0,0 +1,32 @@
import process from "process";
import { execFile } from "node:child_process";
import path from "path";
import { fileURLToPath } from "url";
import fs from "fs-extra";
const __dirname = path.dirname(fileURLToPath(import.meta.url));
export async function testCmakeBinary(cmakeBinaryPath, { cwd = __dirname, env = process.env } = {}) {
if (cmakeBinaryPath == null || !(await fs.pathExists(cmakeBinaryPath)))
return false;
return new Promise((resolve, reject) => {
const child = execFile(cmakeBinaryPath, ["--version"], {
cwd,
env,
windowsHide: true
});
child.on("exit", (code) => {
if (code == 0)
resolve(true);
else
reject(false);
});
child.on("error", reject);
child.on("disconnect", () => resolve(false));
child.on("close", (code) => {
if (code == 0)
resolve(true);
else
resolve(false);
});
});
}
//# sourceMappingURL=testCmakeBinary.js.map