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 Executable
def executable(name)
bin = `which #{name}`.strip
define_method(name) do |command|
if bin.empty?
raise Informative, "Unable to locate the executable `#{name}'"
end
if Config.instance.verbose?
puts "#{name} #{command}"
`#{name} #{command} 1>&2`
puts "#{bin} #{command}"
`#{bin} #{command} 1>&2`
else
`#{name} #{command} 2> /dev/null`
`#{bin} #{command} 2> /dev/null`
end
end
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