mirror of
https://code.forgejo.org/forgejo/runner.git
synced 2025-09-15 18:57:01 +00:00
parent
85fde9ee94
commit
33561d42d3
2 changed files with 5 additions and 2 deletions
|
@ -166,14 +166,16 @@ func vmJoin(vm *otto.Otto) {
|
|||
}
|
||||
|
||||
func vmToJSON(vm *otto.Otto) {
|
||||
_ = vm.Set("toJSON", func(o interface{}) string {
|
||||
toJSON := func(o interface{}) string {
|
||||
rtn, err := json.MarshalIndent(o, "", " ")
|
||||
if err != nil {
|
||||
logrus.Errorf("Unable to marsal: %v", err)
|
||||
return ""
|
||||
}
|
||||
return string(rtn)
|
||||
})
|
||||
}
|
||||
_ = vm.Set("toJSON", toJSON)
|
||||
_ = vm.Set("toJson", toJSON)
|
||||
}
|
||||
|
||||
func (rc *RunContext) vmHashFiles() func(*otto.Otto) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue