mirror of
https://github.com/httprunner/httprunner.git
synced 2026-06-01 05:49:40 +08:00
fix: failed to regenerate .debugtalk_gen.py correctly
This commit is contained in:
@@ -5,6 +5,7 @@ import (
|
||||
"os"
|
||||
"os/signal"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"syscall"
|
||||
|
||||
"github.com/httprunner/funplugin"
|
||||
@@ -34,6 +35,17 @@ func initPlugin(path string, logOn bool) (plugin funplugin.IPlugin, err error) {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
if strings.HasSuffix(pluginPath, ".py") {
|
||||
// register funppy plugin
|
||||
genPyPluginPath := filepath.Join(filepath.Dir(pluginPath), PluginPySourceGenFile)
|
||||
err = BuildPlugin(pluginPath, genPyPluginPath)
|
||||
if err != nil {
|
||||
log.Error().Err(err).Str("path", pluginPath).Msg("build plugin failed")
|
||||
return nil, nil
|
||||
}
|
||||
pluginPath = genPyPluginPath
|
||||
}
|
||||
|
||||
// found plugin file
|
||||
plugin, err = funplugin.Init(pluginPath, funplugin.WithLogOn(logOn))
|
||||
if err != nil {
|
||||
@@ -73,14 +85,7 @@ func locatePlugin(path string) (pluginPath string, err error) {
|
||||
|
||||
pluginPath, err = locateFile(path, PluginPySourceFile)
|
||||
if err == nil {
|
||||
// register funppy plugin
|
||||
genPyPluginPath := filepath.Join(filepath.Dir(pluginPath), PluginPySourceGenFile)
|
||||
err = BuildPlugin(pluginPath, genPyPluginPath)
|
||||
if err != nil {
|
||||
log.Error().Err(err).Str("path", pluginPath).Msg("build plugin failed")
|
||||
return
|
||||
}
|
||||
return genPyPluginPath, nil
|
||||
return
|
||||
}
|
||||
|
||||
pluginPath, err = locateFile(path, PluginGoBuiltFile)
|
||||
|
||||
Reference in New Issue
Block a user