fix: default output debugtalk_gen.py by building debugtalk.py

This commit is contained in:
xucong053
2022-05-26 21:57:35 +08:00
parent c08861c9ca
commit c2bcbfd07f
3 changed files with 13 additions and 8 deletions

View File

@@ -14,10 +14,10 @@ import (
)
const (
goPluginFile = "debugtalk.so" // built from go plugin
hashicorpGoPluginFile = "debugtalk.bin" // built from hashicorp go plugin
hashicorpPyPluginFile = "debugtalk.py" // used for hashicorp python plugin
projectInfoFile = "proj.json" // used for ensuring root project
goPluginFile = "debugtalk.so" // built from go plugin
hashicorpGoPluginFile = "debugtalk.bin" // built from hashicorp go plugin
hashicorpPyPluginFile = "debugtalk_gen.py" // used for hashicorp python plugin, automatically generated by HRP
debugtalkPyFile = "debugtalk.py" // write by user
)
func initPlugin(path string, logOn bool) (plugin funplugin.IPlugin, pluginDir string, err error) {
@@ -62,7 +62,7 @@ func initPlugin(path string, logOn bool) (plugin funplugin.IPlugin, pluginDir st
}
func locatePlugin(path string) (pluginPath string, err error) {
// priority: hashicorp plugin (debugtalk.bin > debugtalk.py) > go plugin (debugtalk.so)
// priority: hashicorp plugin (debugtalk.bin > debugtalk_gen.py > debugtalk.py) > go plugin (debugtalk.so)
pluginPath, err = locateFile(path, hashicorpGoPluginFile)
if err == nil {
@@ -74,6 +74,11 @@ func locatePlugin(path string) (pluginPath string, err error) {
return
}
pluginPath, err = locateFile(path, debugtalkPyFile)
if err == nil {
return
}
pluginPath, err = locateFile(path, goPluginFile)
if err == nil {
return