ResolvePaths updates the given refs to be absolute paths, relative to the given base directory
(refs []*string, base string)
| 569 | |
| 570 | // ResolvePaths updates the given refs to be absolute paths, relative to the given base directory |
| 571 | func ResolvePaths(refs []*string, base string) error { |
| 572 | for _, ref := range refs { |
| 573 | // Don't resolve empty paths |
| 574 | if len(*ref) > 0 { |
| 575 | // Don't resolve absolute paths |
| 576 | if !filepath.IsAbs(*ref) { |
| 577 | *ref = filepath.Join(base, *ref) |
| 578 | } |
| 579 | } |
| 580 | } |
| 581 | return nil |
| 582 | } |
| 583 | |
| 584 | // RelativizePathWithNoBacksteps updates the given refs to be relative paths, relative to the given base directory as long as they do not require backsteps. |
| 585 | // Any path requiring a backstep is left as-is as long it is absolute. Any non-absolute path that can't be relativized produces an error |
no outgoing calls
no test coverage detected