From 010da299570873770e99826fc696dc4ad302d19c Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Tue, 20 May 2014 16:54:59 -0400 Subject: [PATCH] FIX: Plugin transpilation should work in workspaces that aren't called `discourse` --- .../tilt/es6_module_transpiler_template.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/es6_module_transpiler/tilt/es6_module_transpiler_template.rb b/lib/es6_module_transpiler/tilt/es6_module_transpiler_template.rb index f31b8bdfaa1..7103e412665 100644 --- a/lib/es6_module_transpiler/tilt/es6_module_transpiler_template.rb +++ b/lib/es6_module_transpiler/tilt/es6_module_transpiler_template.rb @@ -92,8 +92,9 @@ module Tilt def module_name(root_path, logical_path) path = nil + root_base = File.basename(Rails.root) # 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 = Discourse.plugins.find {|p| p.path == plugin_path }