Skip to content

Commit

Permalink
Fix some bugs in the watcher when files were added and removed.
Browse files Browse the repository at this point in the history
  • Loading branch information
chriseppstein committed Dec 10, 2013
1 parent 7a9c45d commit 1ec02fc
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
7 changes: 7 additions & 0 deletions cli/lib/compass/compiler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,12 @@ def new_config?
nil
end

def reset!
reset_staleness_checker!
@sass_files = nil
@css_files = nil
end

def clean!
remove options[:cache_location]
css_files.each do |css_file|
Expand Down Expand Up @@ -154,6 +160,7 @@ def compile(sass_filename, css_filename)
end

def should_compile?(sass_filename, css_filename)
return true unless css_filename && File.exist?(css_filename)
options[:force] || needs_update?(css_filename, sass_filename)
end

Expand Down
4 changes: 2 additions & 2 deletions cli/lib/compass/watcher/compiler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def initialize(working_path, additional_options={})

def compile
@memory_cache.reset! if @memory_cache
compiler.reset_staleness_checker!
compiler.reset!
if file = compiler.out_of_date?
begin
time = Time.now.strftime("%T")
Expand Down Expand Up @@ -56,4 +56,4 @@ def determine_cache_location
end
end
end
end
end
2 changes: 1 addition & 1 deletion cli/lib/compass/watcher/project_watcher.rb
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def sass_added(file)

def sass_removed(file)
log_action(:info, "#{filename_for_display(file)} was removed", options)
css_file = compiler.corresponding_css_file(File.join(project_path, file))
css_file = compiler.corresponding_css_file(file)
compile
if File.exists?(css_file)
remove(css_file)
Expand Down

0 comments on commit 1ec02fc

Please sign in to comment.