Commit 75d35a23 authored by Eloy Duran's avatar Eloy Duran

Improve error reporting if an executable can't be found.

parent 39b687ee
module Pod module Pod
module Executable module Executable
def executable(name) def executable(name)
bin = `which #{name}`.strip
define_method(name) do |command| define_method(name) do |command|
if bin.empty?
raise Informative, "Unable to locate the executable `#{name}'"
end
if Config.instance.verbose? if Config.instance.verbose?
puts "#{name} #{command}" puts "#{bin} #{command}"
`#{name} #{command} 1>&2` `#{bin} #{command} 1>&2`
else else
`#{name} #{command} 2> /dev/null` `#{bin} #{command} 2> /dev/null`
end end
end end
private name private name
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment