lib/git/status_all.rb in git-status-all-1.1.0 vs lib/git/status_all.rb in git-status-all-1.1.2
- old
+ new
@@ -19,14 +19,20 @@
version "git-status-all #{Git::StatusAll::VERSION} (c) 2016 @reednj (reednj@gmail.com)"
banner "Usage: git-status-all [options] [path]"
opt :fetch, "perform fetch for each repository before getting status", :default => false
end
- dev_dir = ARGV.last || '.'
- repo_paths = Dir.entries(dev_dir).
- map {|p| { :name => p, :path => File.expand_path(p, dev_dir) } }.
- select { |p| Git.repo? p[:path] }
-
+ repo_paths = []
+
+ begin
+ dev_dir = ARGV.last || '.'
+ repo_paths = Dir.entries(dev_dir).
+ map {|p| { :name => p, :path => File.expand_path(p, dev_dir) } }.
+ select { |p| Git.repo? p[:path] }
+ rescue => e
+ $stderr.puts "Could not read repositories in '#{dev_dir}': #{e}"
+ end
+
repo_paths.each do |p|
name = p[:name]
begin
g = Git.open p[:path]