Merge pull request #404 from mslacken/only-build-assigned-overlays

only build assigned overlays
This commit is contained in:
Christian Goll
2022-05-13 10:06:19 +02:00
committed by GitHub
2 changed files with 40 additions and 2 deletions

View File

@@ -72,6 +72,33 @@ func RandomString(n int) string {
return string(b)
}
/*
Checks if given string is in slice. I yes returns true, false otherwise.
*/
func InSlice(slice []string, match string) bool {
for _, val := range slice {
if val == match {
return true
}
}
return false
}
/*
Checks if one or more elements of a slice A are a part of slice B. Returns true
as soon as one element matches.\
*/
func SliceInSlice(A []string, B []string) bool {
for _, a := range A {
for _, b := range B {
if a == b {
return true
}
}
}
return false
}
func IsDir(path string) bool {
wwlog.Printf(wwlog.DEBUG, "Checking if path exists as a directory: %s\n", path)