Skip to content

A platform for community discussion. Free, open, simple.

also watch CSS in unicorn on dev

Sam800760e353b1
diff --git a/config/environments/development.rb b/config/environments/development.rb
index d9c10db2e8a..94a96f10848 100644
--- a/config/environments/development.rb
+++ b/config/environments/development.rb
@@ -52,7 +52,7 @@ Discourse::Application.configure do
config.developer_emails = emails.split(",").map(&:downcase).map(&:strip)
end
- if defined?(Rails::Server) || defined?(Puma)
+ if defined?(Rails::Server) || defined?(Puma) || defined?(Unicorn)
require 'stylesheet/watcher'
STDERR.puts "Starting CSS change watcher"
@watcher = Stylesheet::Watcher.watch
diff --git a/lib/stylesheet/watcher.rb b/lib/stylesheet/watcher.rb
index f0778b38dc2..952118ba454 100644
--- a/lib/stylesheet/watcher.rb
+++ b/lib/stylesheet/watcher.rb
@@ -68,9 +68,12 @@ module Stylesheet
Stylesheet::Manager.cache.clear
message = ["desktop", "mobile", "admin"].map do |name|
- { target: name, new_href: Stylesheet::Manager.stylesheet_href(name.to_sym) , theme_key: SiteSetting.default_theme_key }
+ {
+ target: name,
+ new_href: Stylesheet::Manager.stylesheet_href(name.to_sym),
+ theme_key: SiteSetting.default_theme_key
+ }
end
-
MessageBus.publish '/file-change', message
end