Skip to content

Commit

Permalink
Fix checking that resource is directory
Browse files Browse the repository at this point in the history
  • Loading branch information
swiftyfinch committed Mar 17, 2024
1 parent cb55bf4 commit ad15847
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Sources/Implementation/Manager/FilesManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ extension FileManager.DirectoryEnumerator {
func folderURLs() throws -> [URL] {
try compactMap { element in
guard let url = (element as? URL)?.standardizedFileURL else { return nil }
let resourceValues = try url.resourceValues(forKeys: [.isRegularFileKey])
let isDirectory = (resourceValues.isRegularFile != true)
let resourceValues = try url.resourceValues(forKeys: [.isDirectoryKey])
let isDirectory = (resourceValues.isDirectory == true)
return isDirectory ? url : nil
}
}
Expand Down

0 comments on commit ad15847

Please sign in to comment.