MCPcopy Index your code
hub / github.com/jetify-com/devbox / SplitOutputs

Method SplitOutputs

nix/flake/flakeref.go:678–698  ·  view source on GitHub ↗

SplitOutputs splits and sorts the comma-separated list of outputs. It skips any empty outputs. If one or more of the outputs is a "*", then the result will be a slice with a single "*" element.

()

Source from the content-addressed store, hash-verified

676// any empty outputs. If one or more of the outputs is a "*", then the result
677// will be a slice with a single "*" element.
678func (fi Installable) SplitOutputs() []string {
679 if fi.Outputs == "" {
680 return []string{}
681 }
682
683 split := strings.Split(fi.Outputs, ",")
684 i := 0
685 for _, out := range split {
686 // A wildcard takes priority over any other outputs.
687 if out == "*" {
688 return []string{"*"}
689 }
690 if out != "" {
691 split[i] = out
692 i++
693 }
694 }
695 split = split[:i]
696 slices.Sort(split)
697 return split
698}
699
700// String encodes the installable as a Nix command line argument. It normalizes
701// the result such that if two installable values are equal, then their strings

Callers 3

ParseInstallableFunction · 0.95
StringMethod · 0.95
addDependencyMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected