harness-drone/shared/build/script/inject.go
2014-10-12 13:02:53 -07:00

16 lines
264 B
Go

package script
import (
"strings"
)
func Inject(script string, params map[string]string) string {
if params == nil {
return script
}
injected := script
for k, v := range params {
injected = strings.Replace(injected, "$$"+k, v, -1)
}
return injected
}