check if trufflehog is installed on_start

Signed-off-by: Hadi <112569860+anotherhadi@users.noreply.github.com>
This commit is contained in:
Hadi
2026-05-19 21:02:35 +02:00
parent 4240c4ceb9
commit 87fa9448d6
4 changed files with 82 additions and 22 deletions
+4 -7
View File
@@ -292,22 +292,19 @@ func pushEntry(L *lua.LState, e db.Entry) *lua.LTable {
return t
}
func callHook(p *Plugin, hookName string, args ...lua.LValue) (string, error) {
func callHook(p *Plugin, hookName string, args ...lua.LValue) (lua.LValue, error) {
fn := p.L.GetGlobal(hookName)
if fn == lua.LNil {
return "", nil
return lua.LNil, nil
}
if err := p.L.CallByParam(lua.P{
Fn: fn,
NRet: 1,
Protect: true,
}, args...); err != nil {
return "", err
return lua.LNil, err
}
ret := p.L.Get(-1)
p.L.Pop(1)
if s, ok := ret.(lua.LString); ok {
return string(s), nil
}
return "", nil
return ret, nil
}