Skip to content

Commit 790faa9

Browse files
committed
[fix]: location kind
1 parent aeaf14a commit 790faa9

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

Sources/ScriptToolkit/FileManagerExtension.swift

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,18 @@ public extension FileManager {
2424
}
2525

2626
/// Type of location in path
27-
func locationKind(for path: String) -> LocationKind {
27+
func locationKind(for path: String) -> LocationKind? {
2828
var isFolder: ObjCBool = false
2929

3030
guard fileExists(atPath: path, isDirectory: &isFolder) else {
31-
return .file
31+
return nil
3232
}
3333

34-
return .folder
34+
if isFolder.boolValue {
35+
return .folder
36+
}
37+
else {
38+
return .file
39+
}
3540
}
3641
}

0 commit comments

Comments
 (0)