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 20:28:48 UTC
[whimsy] branch master updated: Tidy; 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 419aeea Tidy; don't use system shell
419aeea is described below
commit 419aeeaf486a5d04b010dcfecfc2d0065f81314a
Author: Sebb <se...@apache.org>
AuthorDate: Wed Jul 8 21:28:40 2020 +0100
Tidy; don't use system shell
---
tools/membersort.rb | 19 +++++++++----------
1 file changed, 9 insertions(+), 10 deletions(-)
diff --git a/tools/membersort.rb b/tools/membersort.rb
index bd7630b..d900e49 100644
--- a/tools/membersort.rb
+++ b/tools/membersort.rb
@@ -1,23 +1,22 @@
+#!/usr/bin/env ruby
+
# svn update and sort the members.txt file and show the differences
$LOAD_PATH.unshift '/srv/whimsy/lib'
require 'whimsy/asf'
-FOUNDATION = ASF::SVN['foundation']
-
-Dir.chdir FOUNDATION
-
-members = FOUNDATION + '/members.txt'
-puts 'svn update ' + members
-system 'svn update ' + members
+members = File.join(ASF::SVN['foundation'], 'members.txt')
+cmd = %w(svn update) << members
+puts cmd.join(' ')
+system *cmd
-source = File.read('members.txt')
+source = File.read(members)
sorted = ASF::Member.sort(source)
if source == sorted
puts 'no change'
else
- File.write('members.txt', sorted)
- system 'svn diff members.txt'
+ File.write(members, sorted)
+ system 'svn', 'diff', members
end