[gtk-mac-bundler] Don’t make empty directories in the bundle.



commit bce1211bb85efccfde2819a3cf9944ceacc3cd53
Author: John Ralls <jralls ceridwen us>
Date:   Fri Jan 6 10:21:19 2017 -0800

    Don’t make empty directories in the bundle.

 bundler/project.py |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/bundler/project.py b/bundler/project.py
index d89ef57..077664c 100644
--- a/bundler/project.py
+++ b/bundler/project.py
@@ -112,13 +112,18 @@ class Path(object):
         source_parent, source_tail = os.path.split(source)
         for root, dirs, files in os.walk(source_parent):
             destdir = os.path.join(dest, os.path.relpath(root, source_parent))
+            glob_list = glob.glob(os.path.join(root, source_tail))
+            if not glob_list:
+                continue
             utils.makedirs(destdir)
-            for globbed_source in glob.glob(os.path.join(root, source_tail)):
+            for globbed_source in glob_list:
                 self.copy_file(project, globbed_source, destdir)
 
     def copy_target_recursive(self, project, source, dest):
         for root, dirs, files in os.walk(source):
             destdir = os.path.join(dest, os.path.relpath(root, source))
+            if not files:
+                continue
             utils.makedirs(destdir)
             for file in files:
                 self.copy_file(project, os.path.join(root, file), destdir)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]