Skip to content

Commit

Permalink
Added zcat / gzcat detection.
Browse files Browse the repository at this point in the history
  • Loading branch information
watsonian committed Dec 7, 2009
1 parent fe67b30 commit 36d8a89
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Empty file modified bin/clarity 100644 → 100755
Empty file.
3 changes: 2 additions & 1 deletion lib/clarity/commands/grep_command_builder.rb
Expand Up @@ -39,7 +39,8 @@ def exec_functions


def gzip_tools
terms.empty? ? ['gzcat filename'] : ['zgrep options -e term filename'] + ['grep options -e term'] * (terms.size-1)
cat_tool = (ENV["PATH"].split(":").find{|d| File.exists?(File.join(d, "gzcat"))} ? "zcat" : "gzcat")
terms.empty? ? ["#{cat_tool} filename"] : ['zgrep options -e term filename'] + ['grep options -e term'] * (terms.size-1)
end

def bzip_tools
Expand Down

0 comments on commit 36d8a89

Please sign in to comment.