Skip to content

Commit b99fd40

Browse files
committed
Resources: Use path names for ignored dirs
### Description Ignored directories are collected for the sake of exporters that use a blacklist-style approach similar to these build tools. This ignore list will include `/filer/<gibberish>` when exported from the online Compiler. This patch fixes that behavoir. ### Pull request type [x] Fix [ ] Refactor [ ] Target update [ ] Functionality change [ ] Docs update [ ] Test update [ ] Breaking change
1 parent 00fcdb8 commit b99fd40

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

tools/resources/__init__.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ def add_directory(
394394

395395
root_path = join(relpath(root, base_path))
396396
if self._ignoreset.is_ignored(join(root_path,"")):
397-
self.ignore_dir(root_path)
397+
self.ignore_dir(join(into_path, root_path))
398398
dirs[:] = []
399399
continue
400400

@@ -407,11 +407,17 @@ def add_directory(
407407
if (any(self._not_current_label(d, t) for t
408408
in self._labels.keys())):
409409
self._label_paths.append((dir_path, base_path, into_path))
410-
self.ignore_dir(relpath(dir_path, base_path))
410+
self.ignore_dir(join(
411+
into_path,
412+
relpath(dir_path, base_path)
413+
))
411414
dirs.remove(d)
412415
elif (d.startswith('.') or d in self._legacy_ignore_dirs or
413416
self._ignoreset.is_ignored(join(root_path, d, ""))):
414-
self.ignore_dir(relpath(dir_path, base_path))
417+
self.ignore_dir(join(
418+
into_path,
419+
relpath(dir_path, base_path)
420+
))
415421
dirs.remove(d)
416422

417423
# Add root to include paths
@@ -452,12 +458,12 @@ def _add_file(self, file_path, base_path, into_path):
452458
scanning starting as base_path
453459
"""
454460

461+
fake_path = join(into_path, relpath(file_path, base_path))
455462
if (self._ignoreset.is_ignored(relpath(file_path, base_path)) or
456463
basename(file_path).startswith(".")):
457-
self.ignore_dir(relpath(file_path, base_path))
464+
self.ignore_dir(fake_path)
458465
return
459466

460-
fake_path = join(into_path, relpath(file_path, base_path))
461467
_, ext = splitext(file_path)
462468
try:
463469
file_type = self._EXT[ext.lower()]

0 commit comments

Comments
 (0)