Convert try to convert absolute path to relative path based on current workspace.
(absPath string)
| 479 | |
| 480 | // Convert try to convert absolute path to relative path based on current workspace. |
| 481 | func ToRelPath(absPath string) string { |
| 482 | relativePath, err := filepath.Rel(dirs.WorkspaceDir, absPath) |
| 483 | if err != nil { |
| 484 | return filepath.ToSlash(absPath) |
| 485 | } |
| 486 | return "${WORKSPACE_ROOT}/" + filepath.ToSlash(relativePath) |
| 487 | } |
| 488 | |
| 489 | func IsSubPath(parent, child string) bool { |
| 490 | rel, err := filepath.Rel(parent, child) |
no outgoing calls
no test coverage detected