whimsical-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject [whimsy] branch master updated: Must not update index file on every run
Date Mon, 10 Sep 2018 10:23:38 GMT
This is an automated email from the ASF dual-hosted git repository.

sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/whimsy.git


The following commit(s) were added to refs/heads/master by this push:
     new b2dbc4c  Must not update index file on every run
b2dbc4c is described below

commit b2dbc4c09c34089b986b4c2f00fa4a1b27c86c72
Author: Sebb <sebb@apache.org>
AuthorDate: Mon Sep 10 11:23:36 2018 +0100

    Must not update index file on every run
---
 tools/collate_minutes.rb | 14 ++++----------
 1 file changed, 4 insertions(+), 10 deletions(-)

diff --git a/tools/collate_minutes.rb b/tools/collate_minutes.rb
index 9cdece9..507e51d 100755
--- a/tools/collate_minutes.rb
+++ b/tools/collate_minutes.rb
@@ -81,14 +81,8 @@ if File.exist? INDEX_FILE
 
   if File.stat(INDEX_FILE).mtime >= input
     Wunderbar.info "All up to date!"
-    unless force
-      # Add stamp to index page
-      page = File.read(INDEX_FILE)
-      open(INDEX_FILE, 'w') { |file|
-        file.write page.sub(/(Last run: )\d{4}-\d\d-\d\d \d\d:\d\d(\. The data is extracted
from a list of)/,"\\1#{STAMP}\\2")
-      }
-      exit
-    end
+    # Do not update the index file as its timestamp is used as a marker for the last update
+    exit unless force
   end
 end
 
@@ -740,8 +734,8 @@ def layout(title = nil)
     x.p do
       if title
         x.text! "This was extracted (@ #{STAMP}) from a list of"
-      else # main index, which is always replaced
-        x.text! "Last run: #{STAMP}. The data is extracted from a list of"
+      else # main index, which is always replaced if any input files have changed
+        x.text! "Last changed: #{STAMP}. The data is extracted from a list of"
       end
       x.a 'minutes', :href => 'http://www.apache.org/foundation/records/minutes/'
       x.text! "which have been approved by the Board."


Mime
View raw message