Permalink
Browse files

single command update for reference repositories

 On branch master

	new file:   bin/update_reference_repositories
	modified:   lib/update_reference_projects.rb
  • Loading branch information...
kixxauth committed Jan 15, 2012
1 parent 2108fa9 commit 4e63cee1ce7facd45c5d250c849781de57074a3b
Showing with 13 additions and 2 deletions.
  1. +2 −0 bin/update_reference_repositories
  2. +11 −2 lib/update_reference_projects.rb
@@ -0,0 +1,2 @@
+#!/bin/bash
+ruby "$HOME/local/lib/update_reference_projects.rb"
@@ -6,10 +6,19 @@
File.open(REPO_LIST, 'r').each do |line|
if RX_REPO =~ line
dirname = "#{REFDIR}/#{$~[:dir]}"
+
+ Dir.chdir(REFDIR)
if File.directory?(dirname)
- puts 'its a directory'
+ Dir.chdir(dirname)
+ if %x[ git pull origin master ]
+ puts "git pulled #{line}"
+ else
+ puts "! ERROR: unable to git pull #{line}"
+ end
+ elsif %x[ git clone #{line}]
+ puts "git cloned #{line}"
else
- puts 'its not a directory'
+ puts "! ERROR: unable to git clone #{line}"
end
end
end

0 comments on commit 4e63cee

Please sign in to comment.