Skip to content

Commit 381223a

Browse files
committed
Fixing zipped makefile exports.
When zipping up projects, the makefile exporter brings every directory supplied as --source under the same directory, even if they are in a parent directory. There was some code that was clearing the leading "../" components. This lead to an empty string ("") being supplied to the "into_path" arg for "resources.add_directory". Since "" is not None, the default behavior to place it in the same directory was not being used. The extra "" caused a leading "/" to be added, making everything placed a the absolute root of the filesystem ("/"). Now we check to see if the "into_path" is an empty string and ignore it if that's the case.
1 parent a0b9275 commit 381223a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

tools/resources/__init__.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,10 @@ def _all_parents(self, file_path, base_path, into_path):
500500
start_at = index + 1
501501
break
502502
for n in range(start_at, len(components)):
503-
parent_name = self._sep.join([into_path] + components[:n])
503+
parent_name_parts = components[:n]
504+
if into_path:
505+
parent_name_parts.insert(0, into_path)
506+
parent_name = self._sep.join(parent_name_parts)
504507
parent_path = join(base_path, *components[:n])
505508
yield FileRef(parent_name, parent_path)
506509

0 commit comments

Comments
 (0)