Довёл fix20: firewall-mode, staged state, diagnostics, readiness и build-gate

This commit is contained in:
2026-05-07 23:38:55 +05:00
parent 0a8f4e0c3d
commit 4b382d6ef9
25 changed files with 840 additions and 133 deletions
+25 -2
View File
@@ -1,5 +1,28 @@
export async function exists(path: string): Promise<boolean> {
return await Bun.file(path).exists();
import { stat } from "node:fs/promises";
async function statSafe(path: string): Promise<import("node:fs").Stats | null> {
try {
return await stat(path);
} catch (error) {
if (error && typeof error === "object" && "code" in error && (error as { code?: string }).code === "ENOENT") {
return null;
}
throw error;
}
}
export async function pathExists(path: string): Promise<boolean> {
return (await statSafe(path)) !== null;
}
export async function fileExists(path: string): Promise<boolean> {
const st = await statSafe(path);
return st?.isFile() ?? false;
}
export async function dirExists(path: string): Promise<boolean> {
const st = await statSafe(path);
return st?.isDirectory() ?? false;
}
export async function readText(path: string): Promise<string> {