github.com/tilt-dev/tilt@v0.33.15-0.20240515162809-0a22ed45d8a0/pkg/model/logstore/prefix.go (about)

     1  package logstore
     2  
     3  import (
     4  	"fmt"
     5  	"strings"
     6  
     7  	"github.com/tilt-dev/tilt/pkg/model"
     8  )
     9  
    10  func SourcePrefix(n model.ManifestName) string {
    11  	if n == "" || n == model.MainTiltfileManifestName {
    12  		return ""
    13  	}
    14  	max := 13
    15  	spaces := ""
    16  	if len(n) > max {
    17  		n = n[:max-1] + "…"
    18  	} else {
    19  		spaces = strings.Repeat(" ", max-len(n))
    20  	}
    21  	return fmt.Sprintf("%s%s │ ", spaces, n)
    22  }