From ad158476e46ee30052378ba0b49bbe3c5b53b57f Mon Sep 17 00:00:00 2001 From: Vyacheslav Khorkov Date: Mon, 18 Mar 2024 00:33:21 +0500 Subject: [PATCH] Fix checking that resource is directory --- Sources/Implementation/Manager/FilesManager.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Sources/Implementation/Manager/FilesManager.swift b/Sources/Implementation/Manager/FilesManager.swift index 0206ee5..9272182 100644 --- a/Sources/Implementation/Manager/FilesManager.swift +++ b/Sources/Implementation/Manager/FilesManager.swift @@ -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 } }