Skip to content

Commit

Permalink
Add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Racer159 committed Oct 31, 2023
1 parent d8cf223 commit b297056
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/pkg/layout/package.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ func (pp *PackagePaths) Files() map[string]string {

stripBase := func(path string) string {
rel, _ := filepath.Rel(pp.Base, path)
// Convert from the OS path separator to the standard '/' for Windows support
return filepath.ToSlash(rel)
}

Expand Down
1 change: 1 addition & 0 deletions src/pkg/oci/manifest.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ func NewZarfOCIManifest(manifest *ocispec.Manifest) *ZarfOCIManifest {
// Locate returns the descriptor for the first layer with the given path or digest.
func (m *ZarfOCIManifest) Locate(pathOrDigest string) ocispec.Descriptor {
return helpers.Find(m.Layers, func(layer ocispec.Descriptor) bool {
// Convert from the OS path separator to the standard '/' for Windows support
return layer.Annotations[ocispec.AnnotationTitle] == filepath.ToSlash(pathOrDigest) || layer.Digest.Encoded() == pathOrDigest
})
}
Expand Down

0 comments on commit b297056

Please sign in to comment.