loadProjectVars loads project-level variables into global ExprVars.
()
| 493 | |
| 494 | // loadProjectVars loads project-level variables into global ExprVars. |
| 495 | func (c *Celer) loadProjectVars() { |
| 496 | for _, item := range c.project.Vars { |
| 497 | parts := strings.Split(item, "=") |
| 498 | if len(parts) != 2 { |
| 499 | continue |
| 500 | } |
| 501 | |
| 502 | key := strings.TrimSpace(parts[0]) |
| 503 | if key == "" { |
| 504 | continue |
| 505 | } |
| 506 | |
| 507 | value := strings.TrimSpace(parts[1]) |
| 508 | value = strings.Trim(value, `"`) |
| 509 | value = c.exprVars.Expand(value) |
| 510 | c.exprVars.Put(key, value) |
| 511 | } |
| 512 | } |
no test coverage detected