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/08 12:48:46 UTC
[whimsy] branch master updated: SImply; don't use system shell
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 712c07a SImply; don't use system shell
712c07a is described below
commit 712c07ae71bc187475bd823697e8ac2a3132914c
Author: Sebb <se...@apache.org>
AuthorDate: Wed Jul 8 13:48:37 2020 +0100
SImply; don't use system shell
---
tools/iclasort.rb | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/tools/iclasort.rb b/tools/iclasort.rb
index ad7ca3a..c767b81 100644
--- a/tools/iclasort.rb
+++ b/tools/iclasort.rb
@@ -1,20 +1,20 @@
+#!/usr/bin/env ruby
+
$LOAD_PATH.unshift '/srv/whimsy/lib'
require 'whimsy/asf'
-OFFICERS = ASF::SVN['officers']
-
-Dir.chdir OFFICERS
-
-iclas = OFFICERS + '/iclas.txt'
-puts 'svn update ' + iclas
-system 'svn update ' + iclas
+iclas = File.join(ASF::SVN['officers'], 'iclas.txt')
+cmd = ['svn', 'update', iclas]
+puts cmd.join(' ')
+system *cmd
-source = File.read('iclas.txt')
+source = File.read(iclas)
sorted = ASF::ICLA.sort(source)
if source == sorted
puts 'no change'
else
- File.write('iclas.txt', sorted)
- system 'svn diff iclas.txt'
+ puts "Writing sorted file"
+ File.write(iclas, sorted)
+ system 'svn', 'diff', iclas
end