You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
383 B
Go
19 lines
383 B
Go
//go:build !windows
|
|
|
|
package nfs
|
|
|
|
import (
|
|
"git.noahlan.cn/noahlan/ntool/internal/common"
|
|
"path"
|
|
)
|
|
|
|
// Realpath returns the shortest path name equivalent to path by purely lexical processing.
|
|
func Realpath(pathStr string) string {
|
|
pathStr = common.ExpandHome(pathStr)
|
|
|
|
if !IsAbsPath(pathStr) {
|
|
pathStr = JoinSubPaths(common.Workdir(), pathStr)
|
|
}
|
|
return path.Clean(pathStr)
|
|
}
|