Skip to content

Commit ce102cc

Browse files
committed
Do not output empty 'libraries:' field if not needed in sketch.yaml
1 parent 4891ded commit ce102cc

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

internal/arduino/sketch/profiles.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,9 @@ type ProfileRequiredLibraries []*ProfileLibraryReference
187187

188188
// AsYaml outputs the required libraries as Yaml
189189
func (p *ProfileRequiredLibraries) AsYaml() string {
190+
if len(*p) == 0 {
191+
return ""
192+
}
190193
res := " libraries:\n"
191194
for _, lib := range *p {
192195
res += lib.AsYaml()

0 commit comments

Comments
 (0)