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

Function validateCwd

projects/electron/src/modules/code/pty.ts:79–89  ·  view source on GitHub ↗
(cwd: string)

Source from the content-addressed store, hash-verified

77const lifecycleListeners = new Set<(event: PtyLifecycleEvent) => void>()
78
79function validateCwd(cwd: string): void {
80 if (!cwd || typeof cwd !== "string") {
81 throw new Error("cwd must be a non-empty string")
82 }
83 if (!fs.existsSync(cwd)) {
84 throw new Error(`Working directory does not exist: ${cwd}`)
85 }
86 if (!fs.statSync(cwd).isDirectory()) {
87 throw new Error(`Path is not a directory: ${cwd}`)
88 }
89}
90
91function getDefaultShell(): string {
92 if (os.platform() === "win32") {

Callers 1

handleSpawnFunction · 0.70

Calls 1

isDirectoryMethod · 0.80

Tested by

no test coverage detected