Skip to content

Commit

Permalink
fix issue 177 (#200)
Browse files Browse the repository at this point in the history
  • Loading branch information
Skeeve authored Jun 10, 2022
1 parent e52d40c commit abfd01c
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions pkg/mark/attachment.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,16 @@ func ResolveAttachments(
return nil, err
}

for _, attach := range attaches {
checksum, err := getChecksum(attach.Path)
for i, _ := range attaches {
checksum, err := getChecksum(attaches[i].Path)
if err != nil {
return nil, karma.Format(
err,
"unable to get checksum for attachment: %q", attach.Name,
"unable to get checksum for attachment: %q", attaches[i].Name,
)
}

attach.Checksum = checksum
attaches[i].Checksum = checksum
}

remotes, err := api.GetAttachments(page.ID)
Expand Down Expand Up @@ -147,6 +147,10 @@ func ResolveAttachments(
updating[i] = attach
}

for i, _ := range existing {
log.Infof(nil, "keeping unmodified attachment: %q", attaches[i].Name)
}

attaches = []Attachment{}
attaches = append(attaches, existing...)
attaches = append(attaches, creating...)
Expand Down

0 comments on commit abfd01c

Please sign in to comment.