MCPcopy Create free account
hub / github.com/celer-pkg/celer / ToRelPath

Function ToRelPath

pkgs/fileio/file.go:481–487  ·  view source on GitHub ↗

Convert try to convert absolute path to relative path based on current workspace.

(absPath string)

Source from the content-addressed store, hash-verified

479
480// Convert try to convert absolute path to relative path based on current workspace.
481func 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
489func IsSubPath(parent, child string) bool {
490 rel, err := filepath.Rel(parent, child)

Callers 7

GenerateToolchainFileMethod · 0.92
preExposeInstalledDirMethod · 0.92
writeCUDAConfigMethod · 0.92
generateMethod · 0.92
checkAllToolsMethod · 0.92
InitWithPlatformMethod · 0.92
RegisterExprVarsMethod · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected