You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@whimsical.apache.org by se...@apache.org on 2020/07/02 19:04:26 UTC

[whimsy] branch master updated: Use File.join where possible

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 100baec  Use File.join where possible
100baec is described below

commit 100baece5643285451cda547e864d507839650d7
Author: Sebb <se...@apache.org>
AuthorDate: Thu Jul 2 20:04:17 2020 +0100

    Use File.join where possible
---
 www/board/publish_minutes.cgi | 19 +++++++++++--------
 1 file changed, 11 insertions(+), 8 deletions(-)

diff --git a/www/board/publish_minutes.cgi b/www/board/publish_minutes.cgi
index 45ec3a0..d5b1fa5 100755
--- a/www/board/publish_minutes.cgi
+++ b/www/board/publish_minutes.cgi
@@ -72,11 +72,13 @@ _html do
         _.system "mkdir #{year}"
         _.system "svn add #{year}"
       end
-      if File.exist? "#{year}/board_minutes_#{date}.txt"
-        _p "#{year}/board_minutes_#{date}.txt already exists", class: '_stderr'
+      minutes_date = "board_minutes_#{date}.txt"
+      minutes_year = File.join(year, minutes_date)
+      if File.exist? minutes_year
+        _p "#{minutes_year} already exists", class: '_stderr'
       else
-        _.system "cp #{BOARD_PRIVATE}/board_minutes_#{date}.txt #{year}"
-        _.system "svn add #{year}/board_minutes_#{date}.txt"
+        _.system "cp #{BOARD_PRIVATE}/#{minutes_date} #{year}"
+        _.system "svn add #{minutes_year}"
         _p
         _.system [
           'svn', 'commit', '-m', message, year,
@@ -118,13 +120,14 @@ _html do
     Dir.chdir BOARD_PRIVATE do
       updated = false
 
-      if File.exist? "board_minutes_#{date}.txt"
-        _.system "svn rm board_minutes_#{date}.txt"
+      if File.exist? "#{minutes_date}"
+        _.system "svn rm #{minutes_date}"
         updated = true
       end
       
-      if File.exist? "board_agenda_#{date}.txt"
-        _.system "svn mv board_agenda_#{date}.txt archived_agendas"
+      agenda_date = "board_agenda_#{date}.txt"
+      if File.exist? agenda_date
+        _.system "svn mv #{agenda_date} archived_agendas"
         updated = true
       end