Skip to content

Commit

Permalink
chore(output): Add a 'not found' message
Browse files Browse the repository at this point in the history
  • Loading branch information
akabiru committed Aug 9, 2018
1 parent a4e3de7 commit 8dd68b2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
fakerbot (0.2.0)
fakerbot (0.2.3)
faker
pastel (~> 0.7.2)
thor (~> 0.20.0)
Expand Down
6 changes: 5 additions & 1 deletion lib/fakerbot/commands/search.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def initialize(options)

def execute(input)
result = FakerBot::Bot.find(input)
puts tree(result).render
puts result.empty? ? not_found : tree(result).render
end

def tree(input)
Expand All @@ -25,6 +25,10 @@ def tree(input)
end
end
end

def not_found
"\n ☹️ Sorry, we couldn't find a match\n"
end
end
end
end
2 changes: 1 addition & 1 deletion lib/fakerbot/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module FakerBot
VERSION = '0.2.0'.freeze
VERSION = '0.2.3'.freeze
end

0 comments on commit 8dd68b2

Please sign in to comment.