File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -88,6 +88,19 @@ func (builder *PodmanBuilder) buildCmdArgs(
8888 return append (args , buildContainer , "./tools/build-gh.sh" )
8989}
9090
91+ func (builder * PodmanBuilder ) matchBuildArtefacts (patterns ... string ) ([]string , error ) {
92+ var matches []string
93+
94+ for _ , pattern := range patterns {
95+ found , err := filepath .Glob (filepath .Join (builder .workingDir , pattern ))
96+ if err != nil {
97+ return nil , fmt .Errorf ("error with pattern %s: %w" , pattern , err )
98+ }
99+ matches = append (matches , found ... )
100+ }
101+ return matches , nil
102+ }
103+
91104func (builder * PodmanBuilder ) Build (
92105 ctx context.Context ,
93106 buildContainer string ,
@@ -108,7 +121,7 @@ func (builder *PodmanBuilder) Build(
108121 return nil , fmt .Errorf ("failed to build: %w" , err )
109122 }
110123
111- firmwarePaths , err := filepath . Glob ( filepath . Join ( builder . workingDir , "*.bin" ) )
124+ firmwarePaths , err := builder . matchBuildArtefacts ( "*.uf2" , "*.bin" )
112125 if err != nil || len (firmwarePaths ) == 0 {
113126 return nil , fmt .Errorf ("cannot find build artifact: %w" , err )
114127 }
You can’t perform that action at this time.
0 commit comments