mirror of
https://github.com/kubeshark/kubeshark.git
synced 2025-04-28 11:55:51 +00:00
🐛 Fix an issue in the script title retrieval from the first comment once more
This commit is contained in:
parent
28fa6e494f
commit
de7f598001
@ -31,17 +31,18 @@ func ReadScriptFile(path string) (script *Script, err error) {
|
||||
}
|
||||
|
||||
var title string
|
||||
var titleIsSet bool
|
||||
code := content
|
||||
|
||||
var idx0 file.Idx
|
||||
for node, comments := range program.Comments {
|
||||
if (idx0 > 0 && node.Idx0() > idx0) || len(comments) == 0 {
|
||||
if (titleIsSet && node.Idx0() > idx0) || len(comments) == 0 {
|
||||
continue
|
||||
}
|
||||
idx0 = node.Idx0()
|
||||
|
||||
idx0 = node.Idx0()
|
||||
title = comments[0].Text
|
||||
break
|
||||
titleIsSet = true
|
||||
}
|
||||
|
||||
script = &Script{
|
||||
|
Loading…
Reference in New Issue
Block a user