Skip to content

Commit

Permalink
Bug fix: Too many files error in ignored directories
Browse files Browse the repository at this point in the history
The CLI was traversing into directories even if it was added to the
.floydingore file. This fixes that by removing the subdirectories of
ignored directories from os.walk dir list.
  • Loading branch information
narenst committed Apr 28, 2017
1 parent 842c89d commit 2627559
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions floyd/client/files.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ def get_files_in_directory(path, file_type):
total_file_size = 0

for root, dirs, files in os.walk(path):
floyd_logger.debug("Root:{}, Dirs:{}".format(root, dirs))
ignore_dir = False
normalized_path = normalize_path(path, root)
for item in ignore_list_expanded:
Expand All @@ -29,6 +30,8 @@ def get_files_in_directory(path, file_type):
break

if ignore_dir:
# Reset dirs to avoid going further down this directory
dirs[:] = []
floyd_logger.debug("Ignoring directory : {}".format(root))
continue

Expand Down

0 comments on commit 2627559

Please sign in to comment.