always print command that failed
This commit is contained in:
parent
1b6c74bfd5
commit
44e28fdc1c
@ -120,12 +120,20 @@ module Rscons
|
|||||||
end
|
end
|
||||||
|
|
||||||
def execute(short_desc, command)
|
def execute(short_desc, command)
|
||||||
if @varset[:echo] == :command
|
print_command = proc do
|
||||||
puts command.map { |c| c =~ /\s/ ? "'#{c}'" : c }.join(' ')
|
puts command.map { |c| c =~ /\s/ ? "'#{c}'" : c }.join(' ')
|
||||||
|
end
|
||||||
|
if @varset[:echo] == :command
|
||||||
|
print_command.call
|
||||||
elsif @varset[:echo] == :short
|
elsif @varset[:echo] == :short
|
||||||
puts short_desc
|
puts short_desc
|
||||||
end
|
end
|
||||||
system(*command)
|
system(*command).tap do |result|
|
||||||
|
unless result or @varset[:echo] == :command
|
||||||
|
$stdout.write "Failed command was: "
|
||||||
|
print_command.call
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
alias_method :orig_method_missing, :method_missing
|
alias_method :orig_method_missing, :method_missing
|
||||||
|
Loading…
x
Reference in New Issue
Block a user