TODO: make this more robust
(srcPath string, lookupEnv template.Mapping)
| 511 | |
| 512 | // TODO: make this more robust |
| 513 | func expandUser(srcPath string, lookupEnv template.Mapping) string { |
| 514 | if strings.HasPrefix(srcPath, "~") { |
| 515 | home, ok := lookupEnv("HOME") |
| 516 | if !ok { |
| 517 | logrus.Warn("cannot expand '~', because the environment lacks HOME") |
| 518 | return srcPath |
| 519 | } |
| 520 | return strings.Replace(srcPath, "~", home, 1) |
| 521 | } |
| 522 | return srcPath |
| 523 | } |
| 524 | |
| 525 | func transformUlimits(data any) (any, error) { |
| 526 | switch value := data.(type) { |
no outgoing calls
no test coverage detected
searching dependent graphs…