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/10364/merge
Scott Rigby 1 week ago
parent 16924a51db
commit 3d30112468

@ -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