This repository was archived by the owner on Jun 1, 2023. It is now read-only.
File tree 3 files changed +18
-3
lines changed
3 files changed +18
-3
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,12 @@ command(
23
23
let directory = URL ( fileURLWithPath: path)
24
24
guard let directoryEnumerator = fileManager. enumerator ( at: directory, includingPropertiesForKeys: nil ) else { continue }
25
25
for case let url as URL in directoryEnumerator {
26
- guard url. pathExtension == " swift " else { continue }
26
+ var isDirectory : ObjCBool = false
27
+ guard url. pathExtension == " swift " ,
28
+ fileManager. isReadableFile ( atPath: url. path) ,
29
+ fileManager. fileExists ( atPath: url. path, isDirectory: & isDirectory) ,
30
+ isDirectory. boolValue == false
31
+ else { continue }
27
32
sourceFiles. append ( try SourceFile ( file: url, relativeTo: directory) )
28
33
}
29
34
}
Original file line number Diff line number Diff line change @@ -22,7 +22,12 @@ command(
22
22
let directory = URL ( fileURLWithPath: path)
23
23
guard let directoryEnumerator = fileManager. enumerator ( at: directory, includingPropertiesForKeys: nil ) else { continue }
24
24
for case let url as URL in directoryEnumerator {
25
- guard url. pathExtension == " swift " else { continue }
25
+ var isDirectory : ObjCBool = false
26
+ guard url. pathExtension == " swift " ,
27
+ fileManager. isReadableFile ( atPath: url. path) ,
28
+ fileManager. fileExists ( atPath: url. path, isDirectory: & isDirectory) ,
29
+ isDirectory. boolValue == false
30
+ else { continue }
26
31
sourceFiles. append ( try SourceFile ( file: url, relativeTo: directory) )
27
32
}
28
33
}
Original file line number Diff line number Diff line change @@ -28,7 +28,12 @@ command(
28
28
let directory = URL ( fileURLWithPath: path)
29
29
guard let directoryEnumerator = fileManager. enumerator ( at: directory, includingPropertiesForKeys: nil ) else { continue }
30
30
for case let url as URL in directoryEnumerator {
31
- guard url. pathExtension == " swift " else { continue }
31
+ var isDirectory : ObjCBool = false
32
+ guard url. pathExtension == " swift " ,
33
+ fileManager. isReadableFile ( atPath: url. path) ,
34
+ fileManager. fileExists ( atPath: url. path, isDirectory: & isDirectory) ,
35
+ isDirectory. boolValue == false
36
+ else { continue }
32
37
sourceFiles. append ( try SourceFile ( file: url, relativeTo: directory) )
33
38
}
34
39
}
You can’t perform that action at this time.
0 commit comments