Files
OmniRoute/src/mitm/detection/zed.ts
Hernan Javier Ardila Sanchez fd26e601a2 fix(dashboard): use lightweight ping endpoint for MaintenanceBanner (fixes #3040) (#3043)
Integrated into release/v3.8.8. Applied review fixes: moved the SELECT 1 into a pingDb() db helper (no raw SQL in route, Hard Rule #5) + the 503 catch no longer leaks err.message (Hard Rule #12). Thanks @herjarsa!
2026-06-01 14:30:17 -03:00

27 lines
710 B
TypeScript

/**
* Zed editor installation detection.
* Purely filesystem-based — no shell interpolation (Hard Rule #13).
*/
import fs from "node:fs";
import os from "node:os";
import path from "node:path";
import type { DetectionResult } from "../types";
const HOME = os.homedir();
const PATHS = [
"/Applications/Zed.app",
path.join(HOME, "Applications", "Zed.app"),
"/usr/bin/zed",
"/usr/local/bin/zed",
path.join(HOME, ".local", "bin", "zed"),
path.join(HOME, ".local", "share", "zed"),
path.join(HOME, ".config", "zed"),
];
export function detectZed(): DetectionResult {
for (const p of PATHS) {
if (fs.existsSync(p)) return { installed: true, path: p };
}
return { installed: false };
}