FIX: Plugin transpilation should work in workspaces that aren't called
`discourse`
This commit is contained in:
parent
4d3c19f736
commit
010da29957
|
@ -92,8 +92,9 @@ module Tilt
|
||||||
def module_name(root_path, logical_path)
|
def module_name(root_path, logical_path)
|
||||||
path = nil
|
path = nil
|
||||||
|
|
||||||
|
root_base = File.basename(Rails.root)
|
||||||
# If the resource is a plugin, use the plugin name as a prefix
|
# If the resource is a plugin, use the plugin name as a prefix
|
||||||
if root_path =~ /(.*\/discourse\/plugins\/[^\/]+)\//
|
if root_path =~ /(.*\/#{root_base}\/plugins\/[^\/]+)\//
|
||||||
plugin_path = "#{Regexp.last_match[1]}/plugin.rb"
|
plugin_path = "#{Regexp.last_match[1]}/plugin.rb"
|
||||||
|
|
||||||
plugin = Discourse.plugins.find {|p| p.path == plugin_path }
|
plugin = Discourse.plugins.find {|p| p.path == plugin_path }
|
||||||
|
|
Loading…
Reference in New Issue