MCPcopy Create free account
hub / github.com/bearlyai/OpenADE / validateCwd

Function validateCwd

projects/electron/src/modules/code/process.ts:164–174  ·  view source on GitHub ↗

* Validate working directory

(cwd: string)

Source from the content-addressed store, hash-verified

162 * Validate working directory
163 */
164function validateCwd(cwd: string): void {
165 if (!cwd || typeof cwd !== "string") {
166 throw new Error("cwd must be a non-empty string")
167 }
168 if (!fs.existsSync(cwd)) {
169 throw new Error(`Working directory does not exist: ${cwd}`)
170 }
171 if (!fs.statSync(cwd).isDirectory()) {
172 throw new Error(`Path is not a directory: ${cwd}`)
173 }
174}
175
176/**
177 * Generate unique process ID

Callers 2

handleStartCommandFunction · 0.70
handleStartScriptFunction · 0.70

Calls 1

isDirectoryMethod · 0.80

Tested by

no test coverage detected