Output plain list when running brew cask search
without a TTY.
This commit is contained in:
parent
8ec08479ae
commit
d29cb450f7
@ -46,6 +46,11 @@ module Hbc
|
|||||||
end
|
end
|
||||||
|
|
||||||
def self.render_results(exact_match, partial_matches, remote_matches, search_term)
|
def self.render_results(exact_match, partial_matches, remote_matches, search_term)
|
||||||
|
unless $stdout.tty?
|
||||||
|
puts [*exact_match, *partial_matches, *remote_matches]
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
if !exact_match && partial_matches.empty?
|
if !exact_match && partial_matches.empty?
|
||||||
puts "No Cask found for \"#{search_term}\"."
|
puts "No Cask found for \"#{search_term}\"."
|
||||||
return
|
return
|
||||||
|
@ -1,4 +1,8 @@
|
|||||||
describe Hbc::CLI::Search, :cask do
|
describe Hbc::CLI::Search, :cask do
|
||||||
|
before(:each) do
|
||||||
|
allow($stdout).to receive(:tty?).and_return(true)
|
||||||
|
end
|
||||||
|
|
||||||
it "lists the available Casks that match the search term" do
|
it "lists the available Casks that match the search term" do
|
||||||
expect {
|
expect {
|
||||||
Hbc::CLI::Search.run("local")
|
Hbc::CLI::Search.run("local")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user