attempt at making ${} replacement tokens
This commit is contained in:
parent
a1708563be
commit
53081bc4fc
@ -78,7 +78,19 @@ func modifyEntry(f *zip2.File, injectionTarget MacroInjectTarget) *[]byte {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
buff := bytes.Buffer{}
|
||||||
|
|
||||||
idx := bytes.Index(content, injectionTarget.Marker)
|
idx := bytes.Index(content, injectionTarget.Marker)
|
||||||
copy(content[idx:idx+len(injectionTarget.Marker)], injectionTarget.Replacement[0:])
|
if idx < 0 { //we didn't find the tag
|
||||||
return &content
|
return &content
|
||||||
}
|
}
|
||||||
|
buff.Write(content[0:idx])
|
||||||
|
buff.Write(injectionTarget.Replacement)
|
||||||
|
buff.Write(content[(idx + len(injectionTarget.Marker)):])
|
||||||
|
|
||||||
|
//copy(content[idx:idx+len(injectionTarget.Marker)], injectionTarget.Replacement[0:])
|
||||||
|
|
||||||
|
ret := buff.Bytes()
|
||||||
|
return &ret
|
||||||
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user