bubble root.yaml to first

This commit is contained in:
Bel LaPointe
2023-11-06 12:44:31 -07:00
parent 84aa7cb319
commit 92e8e14c08
3 changed files with 30 additions and 16 deletions

View File

@@ -6,6 +6,7 @@ import (
"os"
"path"
"path/filepath"
"sort"
"strings"
)
@@ -50,6 +51,15 @@ func (config config) Targets() []string {
if err != nil {
panic(err)
}
sort.Strings(result)
for i := range result {
if path.Base(result[i]) == "root.yaml" {
newresult := append([]string{result[i]}, result[:i]...)
newresult = append(newresult, result[i+1:]...)
result = newresult
break
}
}
return result
}