lib/gitdocs/runner.rb in gitdocs-0.4.1 vs lib/gitdocs/runner.rb in gitdocs-0.4.2
- old
+ new
@@ -12,11 +12,11 @@
end
SearchResult = Struct.new(:file, :context)
def search(term)
results = []
- sh_string("git grep #{ShellTools.escape(term)}").scan(/(.*?):([^\n]*)/) do |(file, context)|
- results << SearchResult.new(file, context)
+ if result_test = sh_string("git grep #{ShellTools.escape(term)}")
+ result_test.scan(/(.*?):([^\n]*)/) { |(file, context)| results << SearchResult.new(file, context) }
end
results
end
def run