Skip to content

Commit

Permalink
chore: update attach metadata handler for attach
Browse files Browse the repository at this point in the history
Signed-off-by: Billy Zha <[email protected]>
  • Loading branch information
qweeah committed Dec 11, 2024
1 parent 903f73c commit 8fc2cfa
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cmd/oras/internal/display/metadata/template/attach.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import (
type AttachHandler struct {
template string
out io.Writer
target *option.Target
path string
root ocispec.Descriptor
}

Expand All @@ -43,11 +43,11 @@ func NewAttachHandler(out io.Writer, template string) metadata.AttachHandler {

// OnAttached implements AttachHandler.
func (ah *AttachHandler) OnAttached(target *option.Target, root ocispec.Descriptor, _ ocispec.Descriptor) {
ah.target = target
ah.path = target.Path
ah.root = root
}

// Render formats the metadata of attach command.
func (ah *AttachHandler) Render() error {
return output.ParseAndWrite(ah.out, model.NewAttach(ah.root, ah.target.Path), ah.template)
return output.ParseAndWrite(ah.out, model.NewAttach(ah.root, ah.path), ah.template)
}

0 comments on commit 8fc2cfa

Please sign in to comment.