Skip to content

Commit

Permalink
termshark: fix brew style
Browse files Browse the repository at this point in the history
Needed for Homebrew/brew#9408.
  • Loading branch information
MikeMcQuaid committed Dec 16, 2020
1 parent c6277d1 commit d813b35
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Formula/termshark.rb
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def install
system [
"#{bin}/termshark -r #{HOMEBREW_TEMP}/termshark-test.pcap",
" | grep 192.168.44.123",
].join("")
].join

# Pretend to be a tty and run termshark with the temporary pcap. Queue up
# 'q' and 'enter' to terminate. Rely on the exit code of termshark, which
Expand All @@ -90,13 +90,13 @@ def install
"#{bin}/termshark -r #{HOMEBREW_TEMP}/termshark-test.pcap",
"\\\"',pty,setsid,ctty > /dev/null",
]
system testcmds.join("")
system testcmds.join

# "Scrape" the terminal UI for a specific IP address contained in the test
# pcap. Since the output contains ansi terminal codes, use the -a flag to
# grep to ensure it's not treated as binary input.
testcmds[5] = "\\\"',pty,setsid,ctty | grep -a 192.168.44.123 > /dev/null"
system testcmds.join("")
system testcmds.join

# Clean up.
File.delete("#{HOMEBREW_TEMP}/termshark-test.pcap")
Expand Down

0 comments on commit d813b35

Please sign in to comment.