From bafb7eb06b6821506081c24cf2fe8ed92f131f09 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Fri, 28 Apr 2023 08:14:51 -0500 Subject: [PATCH] more embed handling Signed-off-by: Jeff Carr --- plugin.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/plugin.go b/plugin.go index 6894b96..1a98b63 100644 --- a/plugin.go +++ b/plugin.go @@ -115,6 +115,18 @@ func sendCallback(p *aplug, funcName string) func(chan toolkit.Action) { */ func searchPaths(name string) *aplug { var filename string + var pfile []byte + var err error + + // first try to load the embedded plugin file + filename = "plugins/" + name + ".so" + pfile, err = Config.resFS.ReadFile(filename) + if (err == nil) { + log(logError, "write out file here", name, filename, len(pfile)) + exit() + } else { + log(logError, filename, "was not embedded. Error:", err) + } // attempt to write out the file from the internal resource filename = "toolkit/" + name + ".so"