fix: avoid panic when running tests

This commit is contained in:
debugtalk
2022-04-06 13:34:50 +08:00
parent 399ebd00db
commit 5e40e3692d
3 changed files with 11 additions and 6 deletions

View File

@@ -16,7 +16,8 @@ func buildHashicorpGoPlugin() {
cmd := exec.Command("go", "build",
"-o", templatesDir+"debugtalk.bin", templatesDir+"plugin/debugtalk.go")
if err := cmd.Run(); err != nil {
panic(err)
log.Error().Err(err).Msg("build hashicorp go plugin failed")
os.Exit(1)
}
}
@@ -30,7 +31,8 @@ func buildHashicorpPyPlugin() {
pluginFile := templatesDir + "debugtalk.py"
err := scaffold.CopyFile("templates/plugin/debugtalk.py", pluginFile)
if err != nil {
panic(err)
log.Error().Err(err).Msg("build hashicorp python plugin failed")
os.Exit(1)
}
}