mirror of
https://github.com/kubeshark/kubeshark.git
synced 2025-06-21 13:58:49 +00:00
✨ Log the found scripts
This commit is contained in:
parent
5d15667a03
commit
a6dd98d241
@ -9,6 +9,7 @@ import (
|
|||||||
"github.com/robertkrimen/otto/ast"
|
"github.com/robertkrimen/otto/ast"
|
||||||
"github.com/robertkrimen/otto/file"
|
"github.com/robertkrimen/otto/file"
|
||||||
"github.com/robertkrimen/otto/parser"
|
"github.com/robertkrimen/otto/parser"
|
||||||
|
"github.com/rs/zerolog/log"
|
||||||
)
|
)
|
||||||
|
|
||||||
type ScriptingConfig struct {
|
type ScriptingConfig struct {
|
||||||
@ -39,7 +40,8 @@ func (config *ScriptingConfig) GetScripts() (scripts []*Script, err error) {
|
|||||||
|
|
||||||
filename := f.Name()
|
filename := f.Name()
|
||||||
var body []byte
|
var body []byte
|
||||||
body, err = os.ReadFile(filepath.Join(config.Source, filename))
|
path := filepath.Join(config.Source, filename)
|
||||||
|
body, err = os.ReadFile(path)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -68,6 +70,8 @@ func (config *ScriptingConfig) GetScripts() (scripts []*Script, err error) {
|
|||||||
Title: title,
|
Title: title,
|
||||||
Code: code,
|
Code: code,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
log.Info().Str("path", path).Msg("Found script:")
|
||||||
}
|
}
|
||||||
|
|
||||||
return
|
return
|
||||||
|
Loading…
Reference in New Issue
Block a user