From 1348678be1c57981eb1e427dc2ff4aa51ceb012b Mon Sep 17 00:00:00 2001 From: Pierre-Olivier Mercier Date: Wed, 8 Mar 2023 11:50:13 +0100 Subject: [PATCH] Don't rely on a fixed number of line to hide, expect first command --- works.go | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/works.go b/works.go index 4bba8b2..30aed6d 100644 --- a/works.go +++ b/works.go @@ -481,10 +481,15 @@ func declareAPIAuthWorksRoutes(router *gin.RouterGroup) { } keeptLogs := []*drone.Line{} - for nline, line := range result { + firstCmdShown := false + for _, line := range result { // Infos about image, skip - if nline < 3 { - continue + if !firstCmdShown { + if strings.HasPrefix(line.Message, "+ ") { + firstCmdShown = true + } else { + continue + } } if strings.HasPrefix(line.Message, "+ export GRADE") { continue