Skip to content

Commit d925d12

Browse files
committed
Merge branch 'remove-filer-paths' of https://github.com/theotherjimmy/mbed into dev_rollup
2 parents 9a252cd + b99fd40 commit d925d12

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
@@ -372,7 +372,7 @@ def add_directory(
372372

373373
root_path = join(relpath(root, base_path))
374374
if self._ignoreset.is_ignored(join(root_path,"")):
375-
self.ignore_dir(root_path)
375+
self.ignore_dir(join(into_path, root_path))
376376
dirs[:] = []
377377
continue
378378

@@ -385,11 +385,17 @@ def add_directory(
385385
if (any(self._not_current_label(d, t) for t
386386
in self._labels.keys())):
387387
self._label_paths.append((dir_path, base_path, into_path))
388-
self.ignore_dir(relpath(dir_path, base_path))
388+
self.ignore_dir(join(
389+
into_path,
390+
relpath(dir_path, base_path)
391+
))
389392
dirs.remove(d)
390393
elif (d.startswith('.') or d in self._legacy_ignore_dirs or
391394
self._ignoreset.is_ignored(join(root_path, d, ""))):
392-
self.ignore_dir(relpath(dir_path, base_path))
395+
self.ignore_dir(join(
396+
into_path,
397+
relpath(dir_path, base_path)
398+
))
393399
dirs.remove(d)
394400

395401
# Add root to include paths
@@ -443,12 +449,12 @@ def _add_file(self, file_path, base_path, into_path):
443449
scanning starting as base_path
444450
"""
445451

452+
fake_path = join(into_path, relpath(file_path, base_path))
446453
if (self._ignoreset.is_ignored(relpath(file_path, base_path)) or
447454
basename(file_path).startswith(".")):
448-
self.ignore_dir(relpath(file_path, base_path))
455+
self.ignore_dir(fake_path)
449456
return
450457

451-
fake_path = join(into_path, relpath(file_path, base_path))
452458
_, ext = splitext(file_path)
453459

454460
file_type = self._EXT.get(ext.lower())

0 commit comments

Comments
 (0)