Copy examples directory over, and make the copying more resilient to missing directories.
authorCameron McCormack <cam@mcc.id.au>
Mon, 20 Aug 2012 10:38:38 +1000
changeset 55 2982871b4092
parent 54 455af9540770
child 56 b2d9cbc10596
Copy examples directory over, and make the copying more resilient to missing directories.
build.py
--- a/build.py	Sun Aug 19 16:41:07 2012 +1000
+++ b/build.py	Mon Aug 20 10:38:38 2012 +1000
@@ -16,6 +16,7 @@
 tocopy = """
   style
   images
+  examples
   svg.idl
 """.split()
 
@@ -212,9 +213,15 @@
 
 # Copy over anything else that needs to be copied to 'publish':
 
-tocopypaths = " ".join([join(master_dir, s) for s in tocopy])
+tocopypaths = []
+for f in tocopy:
+  tocopypath = join(master_dir, f)
+  if os.path.exists(tocopypath):
+    tocopypaths.append(tocopypath)
+tocopypaths = " ".join(tocopypaths)
 
-run("rsync -auC " + tocopypaths + " " + publish_dir);
+if tocopypaths != "":
+  run("rsync -auC " + tocopypaths + " " + publish_dir);
 
 # Done: