Fix LocalInstaller Path() to strip version from tarball filenames

Override Path() method to use existing stripPluginName function for archives

Signed-off-by: Scott Rigby <scott@r6by.com>
pull/31174/head
Scott Rigby 1 month ago
parent e90d3a501d
commit b2b03ea79e
No known key found for this signature in database
GPG Key ID: C7C6FBB5B91C1155

@ -129,6 +129,18 @@ func (i *LocalInstaller) installFromArchive() error {
return fs.CopyDir(pluginRoot, i.Path())
}
// Path returns the path where the plugin will be installed.
// For archive sources, strips the version from the filename.
func (i *LocalInstaller) Path() string {
if i.Source == "" {
return ""
}
if i.isArchive {
return filepath.Join(i.PluginsDirectory, stripPluginName(filepath.Base(i.Source)))
}
return filepath.Join(i.PluginsDirectory, filepath.Base(i.Source))
}
// Update updates a local repository
func (i *LocalInstaller) Update() error {
slog.Debug("local repository is auto-updated")

Loading…
Cancel
Save