changeset 1540:322d7b57e5f0 live

Making this work through the api is too complicated for now; this will do OK
author Chris Cannam <chris.cannam@soundsoftware.ac.uk>
date Tue, 02 Jun 2015 10:58:31 +0100
parents 22d57b0e0a77
children 2696466256ff
files extra/soundsoftware/create-repo-authormaps.rb
diffstat 1 files changed, 8 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/extra/soundsoftware/create-repo-authormaps.rb	Thu May 21 17:31:06 2015 +0100
+++ b/extra/soundsoftware/create-repo-authormaps.rb	Tue Jun 02 10:58:31 2015 +0100
@@ -18,7 +18,7 @@
 # This script does that, if given the two directory names as arguments
 # to the -s and -o options. In the above example:
 #
-# create-repo-authormaps.rb -s /var/hg -o /var/repo-export/authormap
+# script/rails runner create-repo-authormaps.rb -s /var/hg -o /var/repo-export/authormap
 #
 # Note that this script will overwrite any existing authormap
 # files. (That's why the output files are given an authormap_ prefix,
@@ -56,17 +56,20 @@
 end
 
 unless File.directory?($repos_base)
-  log("input directory '#{$repos_base}' doesn't exist", :exit => true)
+  puts "input directory '#{$repos_base}' doesn't exist"
+  exit 1
 end
 
 unless File.directory?($out_base)
-  log("output directory '#{$out_base}' doesn't exist", :exit => true)
+  puts "output directory '#{$out_base}' doesn't exist"
+  exit 1
 end
 
 projects = Project.find(:all)
 
 if projects.nil?
-  log('No projects found', :exit => true)
+  puts 'No projects found'
+  exit 1
 end
 
 projects.each do |proj|
@@ -78,7 +81,7 @@
   repo_url = repo.url
   repo_url = repo_url.gsub(/^file:\/*/, "/");
   if repo_url != File.join($repos_base, proj.identifier)
-    log('Project #{proj.identifier} has repo in unsupported location #{repo_url}, skipping')
+    puts 'Project #{proj.identifier} has repo in unsupported location #{repo_url}, skipping'
     next
   end