File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,17 @@ import (
1111 "text/template"
1212)
1313
14+ func exists (path string ) (bool , error ) {
15+ _ , err := os .Stat (path )
16+ if err == nil {
17+ return true , nil
18+ }
19+ if os .IsNotExist (err ) {
20+ return false , nil
21+ }
22+ return false , err
23+ }
24+
1425func groupByMulti (entries []* RuntimeContainer , key , sep string ) map [string ][]* RuntimeContainer {
1526 groups := make (map [string ][]* RuntimeContainer )
1627 for _ , v := range entries {
@@ -48,6 +59,7 @@ func generateFile(config Config, containers []*RuntimeContainer) bool {
4859 templatePath := config .Template
4960 tmpl , err := template .New (filepath .Base (templatePath )).Funcs (template.FuncMap {
5061 "contains" : contains ,
62+ "exists" : exists ,
5163 "groupBy" : groupBy ,
5264 "groupByMulti" : groupByMulti ,
5365 "split" : strings .Split ,
You can’t perform that action at this time.
0 commit comments