mirror of
https://github.com/kyverno/kyverno.git
synced 2025-03-06 16:06:56 +00:00
24 lines
410 B
Go
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
|
|
}
|