[cig-commits] r15856 - doc/geodynamics.org/benchmarks/trunk

luis at geodynamics.org luis at geodynamics.org
Wed Oct 21 13:05:35 PDT 2009


Author: luis
Date: 2009-10-21 13:05:34 -0700 (Wed, 21 Oct 2009)
New Revision: 15856

Modified:
   doc/geodynamics.org/benchmarks/trunk/watcher.c
Log:
Test running ./publish.py from watcher.c

Modified: doc/geodynamics.org/benchmarks/trunk/watcher.c
===================================================================
--- doc/geodynamics.org/benchmarks/trunk/watcher.c	2009-10-21 01:36:51 UTC (rev 15855)
+++ doc/geodynamics.org/benchmarks/trunk/watcher.c	2009-10-21 20:05:34 UTC (rev 15856)
@@ -299,12 +299,14 @@
     struct timespec timeout;
     unsigned int vnode_events;
 
-    /* for reloading */
+    /* for publishing */
+    int publishing = 1;
+
+    /* for reloading browser */
     int reloading = 0;
     char loaded[1024];
 
-    /* don't reload browser, by default */
-    reloading = 0;
+    /* initialize last reloaded filename to the empty string */
     loaded[0] = '\0';
 
     /* figure out if we want to reload browser (argv[1] needs to be "-r"). */
@@ -418,11 +420,20 @@
                 (fflags & NOTE_WRITE) ||
                 (fflags & NOTE_DELETE))
             {
+                /* Regenerate local .html file */
                 system("./generate.py");
 
+                /* Publish changes */
+                if (reloading && publishing)
+                {
+                    // TODO: Add command-line option (don't enable this by default).
+                    system("./publish.py");
+                }
+
                 if (reloading)
                 {
                     char buffer[1000];
+
                     strncpy(buffer, n->path, sizeof(buffer));
                     set_html_extension(buffer);
 



More information about the CIG-COMMITS mailing list