Skip to content

Commit

Permalink
Avoid errors from listen trying to write to read-only directories.
Browse files Browse the repository at this point in the history
  • Loading branch information
nex3 committed Mar 10, 2014
1 parent 5ccd75d commit a404ed2
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/sass/plugin/compiler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,11 @@ def watch(individual_files = [])
end
directories = remove_redundant_directories(directories)

# A Listen version prior to 2.0 will write a test file to a directory to
# see if a watcher supports watching that directory. That breaks horribly
# on read-only directories, so we filter those out.
directories.reject {|d| File.writable?(d)} unless Sass::Util.listen_geq_2?

# TODO: Keep better track of what depends on what
# so we don't have to run a global update every time anything changes.
listener_args = directories + [{:relative_paths => false}]
Expand Down

0 comments on commit a404ed2

Please sign in to comment.