-
-
Notifications
You must be signed in to change notification settings - Fork 12.7k
/
Copy pathlesspipe.rb
44 lines (37 loc) · 1.23 KB
/
lesspipe.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
class Lesspipe < Formula
desc "Input filter for the pager less"
homepage "https://www-zeuthen.desy.de/~friebel/unix/lesspipe.html"
url "https://github.com/wofr06/lesspipe/archive/refs/tags/v2.18.tar.gz"
sha256 "a78c5c2841771adb5cdc7eb918ca8e4865be88cb9f7a53622ca3fa064d5ec5bc"
license all_of: [
"GPL-2.0-only",
"GPL-2.0-or-later", # sxw2txt
"MIT", # code2color
any_of: ["Artistic-1.0-Perl", "GPL-1.0-or-later"], # vimcolor
]
bottle do
sha256 cellar: :any_skip_relocation, all: "7f22b2da49eb3d1351d4ed294dc21a75b794d4db4b10e91f0f4c28903ab32056"
end
uses_from_macos "perl"
on_macos do
depends_on "bash"
end
def install
system "./configure", "--all-completions", "--prefix=#{prefix}"
man1.mkpath
system "make", "install"
end
def caveats
<<~EOS
add the following to your shell profile e.g. ~/.profile or ~/.zshrc:
export LESSOPEN="|#{HOMEBREW_PREFIX}/bin/lesspipe.sh %s"
EOS
end
test do
touch "file1.txt"
touch "file2.txt"
system "tar", "-cvzf", "homebrew.tar.gz", "file1.txt", "file2.txt"
assert_path_exists testpath/"homebrew.tar.gz"
assert_match "file2.txt", pipe_output(bin/"archive_color", shell_output("tar -tvzf homebrew.tar.gz"))
end
end