Merge pull request #885 from bhollis/master

Clear up build errors & always run after_build
This commit is contained in:
Thomas Reynolds 2013-05-04 12:00:52 -07:00
commit c474e2b410

View file

@ -63,14 +63,17 @@ module Middleman::Cli
action GlobAction.new(self, opts) action GlobAction.new(self, opts)
self.class.shared_instance.run_hook :after_build, self
if @had_errors && !@debugging if @had_errors && !@debugging
cmd = "middleman build --verbose" msg = "There were errors during this build"
self.shell.say "There were errors during this build, re-run with `#{cmd}` to see the full exception." unless options["verbose"]
msg << ", re-run with `middleman build --verbose` to see the full exception."
end
self.shell.say msg, :red
end end
exit(1) if @had_errors exit(1) if @had_errors
self.class.shared_instance.run_hook :after_build, self
end end
# Static methods # Static methods
@ -155,7 +158,7 @@ module Middleman::Cli
raise e raise e
exit(1) exit(1)
elsif options["verbose"] elsif options["verbose"]
self.shell.error(response) self.shell.say response, :red
end end
end end