Skip to content

Commit

Permalink
Code refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
andyone committed Dec 5, 2023
1 parent 05cfaf0 commit e95cf67
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions cli/support/support_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ import (

"github.com/essentialkaos/ek/v12/fmtc"
"github.com/essentialkaos/ek/v12/fmtutil"
"github.com/essentialkaos/ek/v12/fsutil"
"github.com/essentialkaos/ek/v12/strutil"
"github.com/essentialkaos/ek/v12/system"
"github.com/essentialkaos/ek/v12/system/container"
)

// ////////////////////////////////////////////////////////////////////////////////// //
Expand All @@ -29,11 +29,12 @@ func showOSInfo() {

printInfo(12, "Name", osInfo.ColoredName())
printInfo(12, "Pretty Name", osInfo.ColoredPrettyName())
printInfo(12, "Version", osInfo.VersionID)
printInfo(12, "Version", osInfo.Version)
printInfo(12, "ID", osInfo.ID)
printInfo(12, "ID Like", osInfo.IDLike)
printInfo(12, "Version ID", osInfo.VersionID)
printInfo(12, "Version Code", osInfo.VersionCodename)
printInfo(12, "Platform ID", osInfo.PlatformID)
printInfo(12, "CPE", osInfo.CPEName)
}

Expand All @@ -53,11 +54,13 @@ func showOSInfo() {

containerEngine := "No"

switch {
case fsutil.IsExist("/.dockerenv"):
switch container.GetEngine() {
case container.DOCKER:
containerEngine = "Yes (Docker)"
case fsutil.IsExist("/run/.containerenv"):
case container.PODMAN:
containerEngine = "Yes (Podman)"
case container.LXC:
containerEngine = "Yes (LXC)"
}

fmtc.NewLine()
Expand Down

0 comments on commit e95cf67

Please sign in to comment.