1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-06 07:57:07 +00:00
kyverno/cmd/cli/kubectl-kyverno/path/path.go
Charles-Edouard Brétéché 2b69ba6772
refactor: move cli path utils package (#8379)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-09-13 15:10:12 +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
}