MCPcopy Create free account
hub / github.com/GoMudEngine/GoMud / GetScript

Method GetScript

internal/buffs/buffspec.go:156–167  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

154}
155
156func (b *BuffSpec) GetScript() string {
157
158 scriptPath := b.GetScriptPath()
159 // Load the script into a string
160 if _, err := os.Stat(scriptPath); err == nil {
161 if bytes, err := util.ReadFile(scriptPath); err == nil {
162 return string(bytes)
163 }
164 }
165
166 return ``
167}
168
169func (b *BuffSpec) GetScriptPath() string {
170 // Load any script for the buff

Callers

nothing calls this directly

Calls 3

GetScriptPathMethod · 0.95
ReadFileFunction · 0.92
StatMethod · 0.45

Tested by

no test coverage detected