Commit 127bbd57 authored by Fabio Pelosin's avatar Fabio Pelosin

[Executable] Raise on execution if the binary can't be found.

parent ebaa7236
......@@ -24,9 +24,6 @@ module Pod
#
def executable(name)
bin = `which #{name}`.strip
raise Informative, "Unable to locate the executable `#{name}`" if bin.empty?
define_method(name) do |command|
Executable.execute_command(bin, command, false)
end
......@@ -54,6 +51,10 @@ module Pod
# @todo Find a way to display the live output of the commands.
#
def self.execute_command(bin, command, raise_on_failure = false)
bin = `which #{name}`.strip
raise Informative, "Unable to locate the executable `#{name}`" if bin.empty?
require 'open4'
full_command = "#{bin} #{command}"
......
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