fix: resolve plugin path relative to binary location + copy plugins in build
- main.go: use filepath.Dir(os.Args[0]) instead of ./plugins for discovery - api/app.go: same fix for ReloadPlugins - build.sh: copy plugins/ to build/bin/plugins/ after wails build - Fixes: plugin not found when binary launched from different CWD
This commit is contained in:
+5
-1
@@ -101,9 +101,13 @@ func expandPath(path string) string {
|
||||
|
||||
// ReloadPlugins re-discovers plugins from disk and returns a summary.
|
||||
func (a *App) ReloadPlugins() (int, string) {
|
||||
// Resolve plugin directories relative to the binary location
|
||||
binDir := filepath.Dir(os.Args[0])
|
||||
pluginDir := filepath.Join(binDir, "plugins")
|
||||
|
||||
discoveryDirs := []string{
|
||||
"~/.config/verstak/plugins",
|
||||
"./plugins",
|
||||
pluginDir,
|
||||
}
|
||||
|
||||
// Expand tilde in all paths
|
||||
|
||||
Reference in New Issue
Block a user