1
0
Fork 0
mirror of https://github.com/haml/haml.git synced 2022-11-09 12:33:31 -05:00

[Sass] Make sass --update use proper exit codes.

Closes gh-234
This commit is contained in:
Nathan Weizenbaum 2010-08-14 18:08:41 -07:00
parent 01a95053f6
commit e8a033af56
2 changed files with 6 additions and 0 deletions

View file

@ -13,6 +13,9 @@
* Understand that mingw counts as Windows.
* Make `sass --update` return a non-0 exit code if one or more files being updated
contained an error.
## 3.0.16
[Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.16).

View file

@ -422,15 +422,18 @@ MSG
end
end
had_error = false
::Sass::Plugin.on_creating_directory {|dirname| puts_action :directory, :green, dirname}
::Sass::Plugin.on_deleting_css {|filename| puts_action :delete, :yellow, filename}
::Sass::Plugin.on_compilation_error do |error, _, _|
raise error unless error.is_a?(::Sass::SyntaxError)
had_error = true
puts_action :error, :red, "#{error.sass_filename} (Line #{error.sass_line}: #{error.message})"
end
if @options[:update]
::Sass::Plugin.update_stylesheets(files)
exit 1 if had_error
return
end