mirror of
https://github.com/anchore/syft.git
synced 2025-11-19 01:13:18 +01:00
* add bubbletea UI Signed-off-by: Alex Goodman <alex.goodman@anchore.com> * swap pipeline to go 1.20.x and add attest guard for cosign binary Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com> * update note in developing.md about the required golang version Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com> * fix merge conflict for windows path handling Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com> * temp test for attest handler Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com> * add addtional test iterations for background reader Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com> --------- Signed-off-by: Alex Goodman <alex.goodman@anchore.com> Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
32 lines
758 B
Go
32 lines
758 B
Go
package ui
|
|
|
|
import (
|
|
tea "github.com/charmbracelet/bubbletea"
|
|
"github.com/wagoodman/go-partybus"
|
|
|
|
"github.com/anchore/bubbly/bubbles/taskprogress"
|
|
"github.com/anchore/syft/internal/log"
|
|
syftEventParsers "github.com/anchore/syft/syft/event/parsers"
|
|
)
|
|
|
|
func (m *Handler) handleFileIndexingStarted(e partybus.Event) []tea.Model {
|
|
path, prog, err := syftEventParsers.ParseFileIndexingStarted(e)
|
|
if err != nil {
|
|
log.WithFields("error", err).Warn("unable to parse event")
|
|
return nil
|
|
}
|
|
|
|
tsk := m.newTaskProgress(
|
|
taskprogress.Title{
|
|
Default: "Index files system",
|
|
Running: "Indexing file system",
|
|
Success: "Indexed file system",
|
|
},
|
|
taskprogress.WithStagedProgressable(prog),
|
|
)
|
|
|
|
tsk.Context = []string{path}
|
|
|
|
return []tea.Model{tsk}
|
|
}
|