Skip to content

Commit 5ab9540

Browse files
committed
[Bazel] Allow the overlay to contain new directories
1 parent 9387fd9 commit 5ab9540

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

utils/bazel/overlay_directories.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -86,12 +86,15 @@ def main(args):
8686
os.path.join(args.overlay, relpath), os.path.join(args.target, relpath)
8787
)
8888

89-
for src_entry in os.listdir(os.path.join(args.src, rel_root)):
90-
if src_entry not in dirs:
91-
relpath = os.path.join(rel_root, src_entry)
92-
_symlink_abs(
93-
os.path.join(args.src, relpath), os.path.join(args.target, relpath)
94-
)
89+
src_path = os.path.join(args.src, rel_root)
90+
if os.path.isdir(src_path):
91+
for src_entry in os.listdir(src_path):
92+
if src_entry not in dirs:
93+
relpath = os.path.join(rel_root, src_entry)
94+
_symlink_abs(
95+
os.path.join(args.src, relpath),
96+
os.path.join(args.target, relpath),
97+
)
9598

9699

97100
if __name__ == "__main__":

0 commit comments

Comments
 (0)