Skip to content

Commit 7408414

Browse files
committed
compile: print platforms stats only if present
1 parent 1388000 commit 7408414

File tree

1 file changed

+18
-17
lines changed

1 file changed

+18
-17
lines changed

cli/compile/compile.go

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -380,24 +380,25 @@ func (r *compileResult) String() string {
380380
}
381381
res += libraries.Render() + "\n"
382382

383-
platforms := table.New()
384-
platforms.SetHeader(
385-
table.NewCell(tr("Used platform"), titleColor),
386-
table.NewCell(tr("Version"), titleColor),
387-
table.NewCell(tr("Path"), pathColor))
388-
boardPlatform := build.GetBoardPlatform()
389-
platforms.AddRow(
390-
table.NewCell(boardPlatform.GetId(), nameColor),
391-
boardPlatform.GetVersion(),
392-
table.NewCell(boardPlatform.GetInstallDir(), pathColor))
393-
if buildPlatform := build.GetBuildPlatform(); buildPlatform != nil &&
394-
buildPlatform.Id != boardPlatform.Id &&
395-
buildPlatform.Version != boardPlatform.Version {
383+
if boardPlatform := build.GetBoardPlatform(); boardPlatform != nil {
384+
platforms := table.New()
385+
platforms.SetHeader(
386+
table.NewCell(tr("Used platform"), titleColor),
387+
table.NewCell(tr("Version"), titleColor),
388+
table.NewCell(tr("Path"), pathColor))
396389
platforms.AddRow(
397-
table.NewCell(buildPlatform.GetId(), nameColor),
398-
buildPlatform.GetVersion(),
399-
table.NewCell(buildPlatform.GetInstallDir(), pathColor))
390+
table.NewCell(boardPlatform.GetId(), nameColor),
391+
boardPlatform.GetVersion(),
392+
table.NewCell(boardPlatform.GetInstallDir(), pathColor))
393+
if buildPlatform := build.GetBuildPlatform(); buildPlatform != nil &&
394+
buildPlatform.Id != boardPlatform.Id &&
395+
buildPlatform.Version != boardPlatform.Version {
396+
platforms.AddRow(
397+
table.NewCell(buildPlatform.GetId(), nameColor),
398+
buildPlatform.GetVersion(),
399+
table.NewCell(buildPlatform.GetInstallDir(), pathColor))
400+
}
401+
res += platforms.Render()
400402
}
401-
res += platforms.Render()
402403
return res
403404
}

0 commit comments

Comments
 (0)