mirror of
https://github.com/kovetskiy/mark.git
synced 2025-04-24 05:42:40 +08:00
fix issue 177 (#200)
This commit is contained in:
parent
e52d40c922
commit
abfd01cc74
@ -42,16 +42,16 @@ func ResolveAttachments(
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, attach := range attaches {
|
for i, _ := range attaches {
|
||||||
checksum, err := getChecksum(attach.Path)
|
checksum, err := getChecksum(attaches[i].Path)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, karma.Format(
|
return nil, karma.Format(
|
||||||
err,
|
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)
|
remotes, err := api.GetAttachments(page.ID)
|
||||||
@ -147,6 +147,10 @@ func ResolveAttachments(
|
|||||||
updating[i] = attach
|
updating[i] = attach
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for i, _ := range existing {
|
||||||
|
log.Infof(nil, "keeping unmodified attachment: %q", attaches[i].Name)
|
||||||
|
}
|
||||||
|
|
||||||
attaches = []Attachment{}
|
attaches = []Attachment{}
|
||||||
attaches = append(attaches, existing...)
|
attaches = append(attaches, existing...)
|
||||||
attaches = append(attaches, creating...)
|
attaches = append(attaches, creating...)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user