()
| 14 | type Scripts map[string]*script |
| 15 | |
| 16 | func (c *ConfigFile) Scripts() Scripts { |
| 17 | if c == nil || c.Shell == nil { |
| 18 | return nil |
| 19 | } |
| 20 | result := make(Scripts) |
| 21 | for name, commands := range c.Shell.Scripts { |
| 22 | comments := "" |
| 23 | if c.ast != nil { |
| 24 | comments = string(c.ast.beforeComment("shell", "scripts", name)) |
| 25 | } |
| 26 | result[name] = &script{ |
| 27 | Commands: *commands, |
| 28 | Comments: comments, |
| 29 | } |
| 30 | } |
| 31 | |
| 32 | return result |
| 33 | } |
| 34 | |
| 35 | func (s Scripts) WithRelativePaths(projectDir string) Scripts { |
| 36 | result := make(Scripts, len(s)) |
no test coverage detected