MCPcopy Create free account
hub / github.com/CopilotKit/CopilotKit / probePath

Function probePath

showcase/scripts/create-integration/index.ts:83–92  ·  view source on GitHub ↗

* Probe a filesystem path and classify the result so callers can * distinguish "not present" from "present but unreadable". Using * fs.existsSync collapses ENOENT and EACCES/EPERM/EIO into a bare * boolean, which means a permissions or I/O fault masquerades as * "missing" and leads to silently w

(p: string)

Source from the content-addressed store, hash-verified

81 * outcomes distinct so callers can warn/exit/proceed appropriately.
82 */
83function probePath(p: string): "missing" | "exists" | "unreadable" {
84 try {
85 fs.statSync(p);
86 return "exists";
87 } catch (err) {
88 const code = (err as NodeJS.ErrnoException).code;
89 if (code === "ENOENT") return "missing";
90 return "unreadable";
91 }
92}
93
94/**
95 * Escape regex metacharacters in a string so it can be safely embedded

Callers 2

mainFunction · 0.85
updateWorkflowsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…