Bumps [github.com/gookit/config/v2](https://github.com/gookit/config) from 2.2.3 to 2.2.4. - [Release notes](https://github.com/gookit/config/releases) - [Commits](https://github.com/gookit/config/compare/v2.2.3...v2.2.4) --- updated-dependencies: - dependency-name: github.com/gookit/config/v2 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
21 lines
464 B
Go
21 lines
464 B
Go
//go:build !windows
|
|
|
|
package fsutil
|
|
|
|
import (
|
|
"path"
|
|
|
|
"github.com/gookit/goutil/internal/comfunc"
|
|
)
|
|
|
|
// Realpath returns the shortest path name equivalent to path by purely lexical processing.
|
|
// Will expand ~ to home dir, and join with workdir if path is relative path.
|
|
func Realpath(pathStr string) string {
|
|
pathStr = comfunc.ExpandHome(pathStr)
|
|
|
|
if !IsAbsPath(pathStr) {
|
|
pathStr = JoinSubPaths(comfunc.Workdir(), pathStr)
|
|
}
|
|
return path.Clean(pathStr)
|
|
}
|