mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-02-05 22:22:27 +00:00
17 lines
264 B
Go
17 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
|
||
|
}
|