mirror of
https://github.com/haml/haml.git
synced 2022-11-09 12:33:31 -05:00
[Sass] Check for updates when starting up --watch.
This commit is contained in:
parent
9ae5e36f8f
commit
6cc604a656
1 changed files with 5 additions and 1 deletions
|
@ -71,9 +71,11 @@ module Sass
|
||||||
# to see if it's been modified more recently than the corresponding CSS file
|
# to see if it's been modified more recently than the corresponding CSS file
|
||||||
# in {file:SASS_REFERENCE.md#css_location-option} `:css_location`}.
|
# in {file:SASS_REFERENCE.md#css_location-option} `:css_location`}.
|
||||||
# If it has, it updates the CSS file.
|
# If it has, it updates the CSS file.
|
||||||
def update_stylesheets
|
def update_stylesheets(individual_files = [])
|
||||||
return if options[:never_update]
|
return if options[:never_update]
|
||||||
|
|
||||||
|
individual_files.each(&method(:update_stylesheet))
|
||||||
|
|
||||||
@checked_for_updates = true
|
@checked_for_updates = true
|
||||||
template_locations.zip(css_locations).each do |template_location, css_location|
|
template_locations.zip(css_locations).each do |template_location, css_location|
|
||||||
|
|
||||||
|
@ -91,6 +93,8 @@ module Sass
|
||||||
end
|
end
|
||||||
|
|
||||||
def watch(individual_files = [])
|
def watch(individual_files = [])
|
||||||
|
update_stylesheets(individual_files)
|
||||||
|
|
||||||
require 'fssm'
|
require 'fssm'
|
||||||
FSSM.monitor do |mod|
|
FSSM.monitor do |mod|
|
||||||
template_locations.zip(css_locations).each do |template_location, css_location|
|
template_locations.zip(css_locations).each do |template_location, css_location|
|
||||||
|
|
Loading…
Add table
Reference in a new issue