MCPcopy Create free account
hub / github.com/arktypeio/arktype / reportExisting

Function reportExisting

ark/type/cli.ts:550–557  ·  view source on GitHub ↗
(stat: Stats | undefined)

Source from the content-addressed store, hash-verified

548 // of failing with EEXIST as POSIX does. "wx" stays as the defense
549 // against a file appearing between the lstat and the write.
550 const reportExisting = (stat: Stats | undefined) => {
551 const detail =
552 stat?.isSymbolicLink() ? "symlink"
553 : stat?.isDirectory() ? "directory"
554 : stat && !stat.isFile() ? "not a regular file"
555 : "pass --force to overwrite"
556 stdout(`ark.json already exists at ${settingsPath} (${detail}).\n`)
557 }
558 const stat = lstatIfExists(settingsPath)
559 if (stat) reportExisting(stat)
560 else {

Callers 1

runInitFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected