Improve error messages

This commit is contained in:
ViViDboarder 2014-09-02 11:19:03 -07:00
parent 53bbf5ab20
commit 3820d1ecd9
2 changed files with 15 additions and 11 deletions

View File

@ -20,7 +20,7 @@ Gem::Specification.new do |s|
s.add_dependency 'thor', '~> 0.16.0'
s.add_dependency 'listen', '~> 0.6.0'
s.add_dependency 'metaforce', '~> 1.0.7'
s.add_dependency 'metaforce', '>= 1.0.7'
s.add_dependency 'highline'
s.add_development_dependency 'rake'

View File

@ -182,19 +182,23 @@ module AbuseTheForce
# If a failed deploy, print errors
if result.success == false
puts "DEPLOY ERRORS: #{result.messages.reject { |m| m.success }.size}"
if result.messages.any?
puts "DEPLOY ERRORS: #{result.messages.reject { |m| m.success }.size}"
result.messages.each do |m|
result.messages.each do |m|
# If the path is not from the project, fix it
unless m.file_name.starts_with? Atf_Config.src
m.file_name = m.file_name.sub(/[a-zA-Z._-]*\//, Atf_Config.src + '/')
end
# Print our error in the format "filename:line:column type in object message"
if !m.success
puts "#{m.file_name}:#{m.line_number}:#{m.column_number} #{m.problem_type} in #{m.full_name} #{m.problem}"
# If the path is not from the project, fix it
unless m.file_name.starts_with? Atf_Config.src
m.file_name = m.file_name.sub(/[a-zA-Z._-]*\//, Atf_Config.src + '/')
end
# Print our error in the format "filename:line:column type in object message"
if !m.success
puts "#{m.file_name}:#{m.line_number}:#{m.column_number} #{m.problem_type} in #{m.full_name} #{m.problem}"
end
end
else
puts "DEPLOY ERRORS: UKNOWN"
end
end # success == false