Skip to content

Commit

Permalink
Tweak part name inside hex-derived bundle a bit
Browse files Browse the repository at this point in the history
CL: none

PUBLISHED_FROM=ce8636d3498bb732536c058915b29effc3f45d3e
  • Loading branch information
Deomid Ryabkov authored and cesantabot committed Dec 4, 2018
1 parent 33d4b5c commit 89b449a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion mos/create_fw_bundle/create_fw_bundle.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package create_fw_bundle
import (
"context"
"encoding/json"
"fmt"
"io/ioutil"
"path/filepath"
"strings"
Expand Down Expand Up @@ -69,8 +70,13 @@ func CreateFWBundle(ctx context.Context, devConn *dev.DevConn) error {
if err != nil {
return errors.Annotatef(err, "%s", ps)
}
for _, hp := range hpp {
for ihp, hp := range hpp {
p1 := *p
if len(hpp) == 1 {
p1.Src = strings.Replace(p.Src, ".hex", ".bin", 1)
} else {
p1.Src = fmt.Sprintf("%s.%d.bin", strings.Replace(p.Src, ".hex", "", 1), ihp)
}
p1.Addr = hp.Addr
p1.Name = hp.Name
p1.Size = hp.Size
Expand Down

0 comments on commit 89b449a

Please sign in to comment.