Skip to content

Commit a7c0a4d

Browse files
committed
Fix Split Image Folder content detection on Linux
1 parent 78dda5f commit a7c0a4d

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/split_parser.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,14 +203,17 @@ def is_user_file(path: "StrPath"):
203203
"""Returns False for hidden files, system files and folders."""
204204
if os.path.isdir(path) or os.path.basename(path).startswith("."):
205205
return False
206+
if sys.platform == "linux":
207+
return True
206208
stat_result = os.stat(path)
207209
if sys.platform == "win32":
208210
return not (
209211
(stat_result.st_file_attributes & FILE_ATTRIBUTE_SYSTEM)
210212
| (stat_result.st_file_attributes & FILE_ATTRIBUTE_HIDDEN)
211213
)
212-
# UF_HIDDEN is present on regular Windows files
213-
return not stat_result.st_mode & UF_HIDDEN
214+
if sys.platform == "darwin":
215+
return not (stat_result.st_mode & UF_HIDDEN)
216+
return True
214217

215218

216219
def __get_images_from_directory(directory: "StrPath"):

0 commit comments

Comments
 (0)