summaryrefslogtreecommitdiff
path: root/pluginCheck.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-09-09 03:16:43 -0500
committerJeff Carr <[email protected]>2025-09-09 03:16:43 -0500
commit1441f90e5a4032c7419e252cc12c6e406d996ed3 (patch)
tree847e329d350cf359777a66ea9046c8aab84198b9 /pluginCheck.go
parente799a19b2cca024cb8effa0da7c97de580d7118c (diff)
smarter init()v0.25.0
Diffstat (limited to 'pluginCheck.go')
-rw-r--r--pluginCheck.go30
1 files changed, 10 insertions, 20 deletions
diff --git a/pluginCheck.go b/pluginCheck.go
index f1514a3..b0369b2 100644
--- a/pluginCheck.go
+++ b/pluginCheck.go
@@ -60,19 +60,6 @@ func checkPluginCompatibility(pluginPath string) error {
return nil
}
-/*
-// tests the plugin file will load
-func testPluginOld() {
- _, err := plugin.Open(argGui.GuiPluginHack)
- if err != nil {
- log.Log(PLUG, "plugin.Open() FAILED =", argGui.GuiPluginHack, err)
- os.Exit(-1)
- }
- log.Log(PLUG, "plugin.Open() SUCCESS loading plugin =", argGui.GuiPluginHack)
- os.Exit(0)
-}
-*/
-
func CheckPlugin() string {
if argGui.GuiPluginHack != "" {
// does os.Exec() and does not return
@@ -85,26 +72,29 @@ func CheckPlugin() string {
// this is a workaround for GO plugins not cleaning up correctly after
// an attempt to load them
func TestPluginAndExit() {
- log.Log(WARN, "TEST plugin START", argGui.GuiPluginHack)
+}
+
+func TestPluginAndExitNew(hackname string) {
+ log.Log(WARN, "TEST plugin START", hackname)
- absPath, err := filepath.Abs(argGui.GuiPluginHack)
+ absPath, err := filepath.Abs(hackname)
if err != nil {
- log.Log(WARN, "TEST plugin FAILED", argGui.GuiPluginHack, absPath, err)
+ log.Log(WARN, "TEST plugin FAILED", hackname, absPath, err)
os.Exit(-1)
}
- log.Log(WARN, "TEST plugin START abs:", absPath, argGui.GuiPluginHack)
+ log.Log(WARN, "TEST plugin START abs:", absPath, hackname)
plug, err := checkPlug(absPath)
if plug == nil {
- log.Log(WARN, "TEST plugin failed (returned nil):", argGui.GuiPluginHack, absPath, err)
+ log.Log(WARN, "TEST plugin failed (returned nil):", hackname, absPath, err)
os.Exit(-1)
}
if err == nil {
- log.Log(WARN, "TEST plugin probably worked", argGui.GuiPluginHack, absPath)
+ log.Log(WARN, "TEST plugin probably worked", hackname, absPath)
log.Log(WARN, "os.Exit(0)")
os.Exit(0)
}
- log.Log(WARN, "TEST plugin failed", argGui.GuiPluginHack, absPath, err)
+ log.Log(WARN, "TEST plugin failed", hackname, absPath, err)
os.Exit(-1)
}