MCPcopy
hub / github.com/cli/cli / createJSONLinesFilePath

Method createJSONLinesFilePath

pkg/cmd/attestation/download/metadata.go:24–36  ·  view source on GitHub ↗
(artifact string)

Source from the content-addressed store, hash-verified

22}
23
24func (s *LiveStore) createJSONLinesFilePath(artifact string) string {
25 if runtime.GOOS == "windows" {
26 // Colons are special characters in Windows and cannot be used in file names.
27 // Replace them with dashes to avoid issues.
28 artifact = strings.ReplaceAll(artifact, ":", "-")
29 }
30
31 path := fmt.Sprintf("%s.jsonl", artifact)
32 if s.outputPath != "" {
33 return fmt.Sprintf("%s/%s", s.outputPath, path)
34 }
35 return path
36}
37
38func (s *LiveStore) createMetadataFile(artifactDigest string, attestationsResp []*api.Attestation) (string, error) {
39 metadataFilePath := s.createJSONLinesFilePath(artifactDigest)

Callers 2

createMetadataFileMethod · 0.95

Calls

no outgoing calls

Tested by 1