fix(cli): classify ENOTDIR JSON input failures (#1000)
Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: morluto <morluto@users.noreply.github.com>
This commit is contained in:
co-authored by
Cursor Agent
morluto
parent
cbc0dd1e7c
commit
a6132be054
+3
-1
@@ -72,7 +72,9 @@ const cannotBeAnExistingFile = (cause: unknown): boolean =>
|
||||
typeof cause === "object" &&
|
||||
cause !== null &&
|
||||
"code" in cause &&
|
||||
(cause.code === "ENOENT" || cause.code === "ENAMETOOLONG");
|
||||
(cause.code === "ENOENT" ||
|
||||
cause.code === "ENAMETOOLONG" ||
|
||||
cause.code === "ENOTDIR");
|
||||
|
||||
const hasExplicitJsonFileExtension = (value: string): boolean =>
|
||||
value.toLowerCase().endsWith(".json");
|
||||
|
||||
Reference in New Issue
Block a user