Permalink
Browse files

Fixes: command_available can run 'type'.

'type' is a Bash builtin in most Linux distros. %x expects a command (a
file) to run, so fails to run the builtin.
  • Loading branch information...
1 parent 169f80d commit 071bd854fabbbe1a09e324914a19dafe80229561 Jordi Funollet committed Nov 1, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/sheet.rb
View
@@ -81,7 +81,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 rescue false
+ %x!bash -c "type #{cmd}" 2>/dev/null!.chomp.length > 0 rescue false
end
# Returns true if ~/.sheets exists

0 comments on commit 071bd85

Please sign in to comment.