@@ -110,13 +110,22 @@ func (s *Builder) Run(context map[string]interface{}) error {
110
110
& MergeSketchWithBootloader {},
111
111
112
112
& RecipeByPrefixSuffixRunner {Prefix : constants .HOOKS_POSTBUILD , Suffix : constants .HOOKS_PATTERN_SUFFIX },
113
+ }
114
+
115
+ mainErr := runCommands (context , commands , true )
113
116
117
+ commands = []types.Command {
114
118
& PrintUsedAndNotUsedLibraries {},
115
119
116
120
& PrintUsedLibrariesIfVerbose {},
117
121
}
122
+ otherErr := runCommands (context , commands , false )
123
+
124
+ if mainErr != nil {
125
+ return mainErr
126
+ }
118
127
119
- return runCommands ( context , commands )
128
+ return otherErr
120
129
}
121
130
122
131
type ParseHardwareAndDumpBuildProperties struct {}
@@ -132,30 +141,34 @@ func (s *ParseHardwareAndDumpBuildProperties) Run(context map[string]interface{}
132
141
& DumpBuildProperties {},
133
142
}
134
143
135
- return runCommands (context , commands )
144
+ return runCommands (context , commands , true )
136
145
}
137
146
138
- func runCommands (context map [string ]interface {}, commands []types.Command ) error {
147
+ func runCommands (context map [string ]interface {}, commands []types.Command , progressEnabled bool ) error {
139
148
commandsLength := len (commands )
140
149
progressForEachCommand := float32 (100 ) / float32 (commandsLength )
141
150
142
151
progress := float32 (0 )
143
152
for _ , command := range commands {
144
153
PrintRingNameIfDebug (context , command )
145
- printProgressIfMachineLogger ( context , progress )
154
+ printProgressIfProgressEnabledAndMachineLogger ( progressEnabled , context , progress )
146
155
err := command .Run (context )
147
156
if err != nil {
148
157
return utils .WrapError (err )
149
158
}
150
159
progress += progressForEachCommand
151
160
}
152
161
153
- printProgressIfMachineLogger ( context , 100 )
162
+ printProgressIfProgressEnabledAndMachineLogger ( progressEnabled , context , 100 )
154
163
155
164
return nil
156
165
}
157
166
158
- func printProgressIfMachineLogger (context map [string ]interface {}, progress float32 ) {
167
+ func printProgressIfProgressEnabledAndMachineLogger (progressEnabled bool , context map [string ]interface {}, progress float32 ) {
168
+ if ! progressEnabled {
169
+ return
170
+ }
171
+
159
172
log := utils .Logger (context )
160
173
if log .Name () == "machine" {
161
174
log .Println (constants .MSG_PROGRESS , strconv .FormatFloat (float64 (progress ), 'f' , 2 , 32 ))
0 commit comments