Skip to content

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

FIX: Plugins may have relative symlinks

Daniel Waterworth15ae3145ec1e
diff --git a/lib/stylesheet/watcher.rb b/lib/stylesheet/watcher.rb
index 4c9ab7f595c..384f7515d10 100644
--- a/lib/stylesheet/watcher.rb
+++ b/lib/stylesheet/watcher.rb
@@ -57,7 +57,11 @@ module Stylesheet
Thread.new do
begin
plugins_paths = Dir.glob("#{Rails.root}/plugins/*").map do |file|
- File.symlink?(file) ? File.readlink(file) : file
+ if File.symlink?(file)
+ File.expand_path(File.readlink(file), "#{Rails.root}/plugins")
+ else
+ file
+ end
end.compact
listener = Listen.to("#{root}/#{watch}", listener_opts) do |modified, added, _|