mirror of
https://github.com/discourse/discourse.git
synced 2025-09-05 08:59:27 +08:00
Upgrade the Listen gem
This commit is contained in:
parent
ef093b1610
commit
22214f5e5c
4 changed files with 13 additions and 5 deletions
|
@ -31,7 +31,7 @@ module Stylesheet
|
|||
@paths.each do |watch|
|
||||
Thread.new do
|
||||
begin
|
||||
Listen.to("#{root}/#{watch}") do |modified, added, _|
|
||||
listener = Listen.to("#{root}/#{watch}", ignore: /xxxx/) do |modified, added, _|
|
||||
paths = [modified, added].flatten
|
||||
paths.compact!
|
||||
paths.map!{|long| long[(root.length+1)..-1]}
|
||||
|
@ -40,6 +40,8 @@ module Stylesheet
|
|||
rescue => e
|
||||
STDERR.puts "Failed to listen for CSS changes at: #{watch}\n#{e}"
|
||||
end
|
||||
listener.start
|
||||
sleep
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue