From 3d30112468fb4171a015210cfabbb0e41a6c6587 Mon Sep 17 00:00:00 2001 From: Scott Rigby Date: Mon, 25 Aug 2025 22:57:42 -0400 Subject: [PATCH] Fix LocalInstaller Path() to strip version from tarball filenames Override Path() method to use existing stripPluginName function for archives Signed-off-by: Scott Rigby --- internal/plugin/installer/local_installer.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/internal/plugin/installer/local_installer.go b/internal/plugin/installer/local_installer.go index 59e8aebfb..87b9eaf97 100644 --- a/internal/plugin/installer/local_installer.go +++ b/internal/plugin/installer/local_installer.go @@ -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")