1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-07 00:17:13 +00:00
kyverno/cmd/cli/kubectl-kyverno/utils/path/path.go
Charles-Edouard Brétéché afd736428f
chore: create cli pathutils package (#8164)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-08-29 18:20:17 +00:00

24 lines
410 B
Go

package path
import (
"path/filepath"
)
func GetFullPath(path string, basePath string) string {
if !filepath.IsAbs(path) {
return filepath.Join(basePath, path)
} else {
return path
}
}
func GetFullPaths(paths []string, basePath string, git bool) []string {
if git {
return paths
}
var out []string
for _, path := range paths {
out = append(out, GetFullPath(path, basePath))
}
return out
}