Permalink
Browse files

return false if command_available throws an exception

  • Loading branch information...
1 parent 4c4bd24 commit c3549499bf45c68ad9b44839383ecec6a4c9211c @oscardelben committed Apr 24, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/sheet.rb
View
@@ -9,7 +9,7 @@
class Sheet
SHEETS_DIR = '~/.sheets/'.freeze
-
+
class << self
# Utility to write to standard output
def write(message)
@@ -75,7 +75,7 @@ def copy_command
# Utility to check wherever a command is available in the user
# system
def command_available?(cmd)
- %x!type #{cmd}!.chomp.length > 0
+ %x!type #{cmd}!.chomp.length > 0 rescue false
end
end

0 comments on commit c354949

Please sign in to comment.