summaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-08-17 15:28:11 -0500
committerJeff Carr <[email protected]>2025-08-17 22:57:06 -0500
commitbd5b16d8755bc9e5f0dc90162bc4724d319c725e (patch)
tree4b7f532675d29493f78b8ab41c0bb925158ee768 /main.go
parentedb3e23311b9cd667898e625b07f5dbeb43e30e3 (diff)
show drives. remove stupid commit of plugin binary. damnit
Diffstat (limited to 'main.go')
-rw-r--r--main.go21
1 files changed, 11 insertions, 10 deletions
diff --git a/main.go b/main.go
index 1a5be65..3e6acdf 100644
--- a/main.go
+++ b/main.go
@@ -6,7 +6,6 @@ package main
import (
"debug/buildinfo"
"embed"
- "fmt"
"os"
"os/exec"
"path/filepath"
@@ -33,6 +32,14 @@ func main() {
gui.InitArg()
me.pp = arg.MustParse(&argv)
+ // check if the binary is being called to test
+ // if the plugin can actually loaded. This is a hack
+ // around needing a Test() plugin load function in GO
+ if gui.IsGoPluginTestHack() {
+ gui.CheckPlugin()
+ os.Exit(0)
+ }
+
if argv.Bash {
argv.doBash()
os.Exit(0)
@@ -42,9 +49,6 @@ func main() {
os.Exit(0)
}
- // checkPlug("../../../toolkits/gocui/gocui.so")
- // checkPlug("/usr/lib/go-gui-toolkits/gocui.v0.22.46.so")
-
/*
if argv.Drives != nil {
doDrives()
@@ -52,9 +56,6 @@ func main() {
}
*/
- // doDrives()
- // okExit("everything compiled")
-
go listenForBlockEvents()
doGui()
okExit("everything compiled")
@@ -117,7 +118,7 @@ func dumpDebug() {
func checkPlug(pluginPath string) *plugin.Plugin {
if err := checkPluginViaSubprocess(pluginPath); err != nil {
- fmt.Printf("Plugin check failed: %v\n", err)
+ log.Printf("Plugin check failed: %v\n", err)
return nil
}
@@ -133,11 +134,11 @@ func checkPlug(pluginPath string) *plugin.Plugin {
func checkPluginViaSubprocess(path string) error {
exe, err := os.Executable()
if err != nil {
- return fmt.Errorf("failed to get executable path: %w", err)
+ return log.Errorf("failed to get executable path: %w", err)
}
resolved, err := filepath.EvalSymlinks(exe)
if err != nil {
- return fmt.Errorf("failed to resolve executable symlink: %w", err)
+ return log.Errorf("failed to resolve executable symlink: %w", err)
}
cmd := exec.Command(resolved, "--gui-check-plugin", path)