Feature #31538
openAllow a plugin to be installed in the directory different from the plugin id
0%
Description
After #31110, we can't install plugin tarball like "foo-plugin-x.y.z" without rename. I want install plugin only stable version. I don't want use svn trunk/git master. And I want to know plugin version easily with its directory name.
I want change default directory like below if I can.
diff --git a/lib/redmine/plugin.rb b/lib/redmine/plugin.rb index b3982fcfd..f75f181be 100644 --- a/lib/redmine/plugin.rb +++ b/lib/redmine/plugin.rb @@ -96,7 +96,10 @@ module Redmine # Set a default name if it was not provided during registration p.name(id.to_s.humanize) if p.name.nil? # Set a default directory if it was not provided during registration - p.directory(File.join(self.directory, id.to_s)) if p.directory.nil? + if p.directory.nil? + dirname = File.basename(File.dirname(block.source_location[0])) + p.directory(File.join(self.directory, dirname)) + end unless File.directory?(p.directory) raise PluginNotFound, "Plugin not found. The directory for plugin #{p.i d} should be #{p.directory}."
Related issues
Updated by Go MAEDA over 5 years ago
- Related to Patch #31110: Raise an exception if the plugin directory name differs from the plugin id added
Updated by Go MAEDA over 5 years ago
- Tracker changed from Defect to Feature
- Subject changed from stable plugin tarball can't install after #31110 to Allow a plugin to be installed in the directory different from the plugin id
- Category changed from Plugin Request to Plugin API
- Target version set to Candidate for next major release
Sho HASHIMOTO wrote:
After #31110, we can't install plugin tarball like "foo-plugin-x.y.z" without rename.
Even without #31110, many plugins don't work if a plugin with the id "foo-plugin" is installed under the directory other than "plugins/foo-plugin".
Anyway, your patch which allows plugins to be placed under any directory name is a nice improvement. I would like to get more feedbacks from plugin developers.
Updated by Sho HASHIMOTO over 5 years ago
Anyway, your patch which allows plugins to be placed under any directory name is a nice improvement. I would like to get more feedbacks from plugin developers.
As Go MAEDA san knows, Redmine::Plugin.register is called from init.rb. So, my patch indicates plugins/foo-plugin only if init.rb was required from other codes..