discourse: Change the path to the auto generated plugin assets

Change the path to the auto generated plugin assets, which defaults to
the plugin's directory and isn't writable at the time of asset
generation.
This commit is contained in:
talyz 2021-08-12 12:37:33 +02:00
parent 6fd5a40cca
commit 443b318ee9
No known key found for this signature in database
GPG Key ID: 2DED2151F4671A2B
2 changed files with 23 additions and 0 deletions

View File

@ -0,0 +1,13 @@
diff --git a/lib/plugin/instance.rb b/lib/plugin/instance.rb
index 380a63e987..b2ce7fa982 100644
--- a/lib/plugin/instance.rb
+++ b/lib/plugin/instance.rb
@@ -403,7 +403,7 @@ class Plugin::Instance
end
def auto_generated_path
- File.dirname(path) << "/auto_generated"
+ "#{Rails.root}/public/assets/auto_generated_plugin_assets/#{name}"
end
def after_initialize(&block)

View File

@ -158,6 +158,11 @@ let
# Use the Ruby API version in the plugin gem path, to match the
# one constructed by bundlerEnv
./plugin_gem_api_version.patch
# Change the path to the auto generated plugin assets, which
# defaults to the plugin's directory and isn't writable at the
# time of asset generation
./auto_generated_path.patch
];
# We have to set up an environment that is close enough to
@ -244,6 +249,11 @@ let
# Use mv instead of rename, since rename doesn't work across
# device boundaries
./use_mv_instead_of_rename.patch
# Change the path to the auto generated plugin assets, which
# defaults to the plugin's directory and isn't writable at the
# time of asset generation
./auto_generated_path.patch
];
postPatch = ''