From ea96d4880eedd92d9c8228b84de028185ec941b2 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Fri, 15 Nov 2024 09:50:13 -0600 Subject: does apt_linux.go vs apt_windows.go work automagically? --- main.go | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'main.go') diff --git a/main.go b/main.go index ab7717c..3368042 100644 --- a/main.go +++ b/main.go @@ -55,6 +55,31 @@ func main() { for pkg, version := range installedPackages { fmt.Printf("%s: %s\n", pkg, version) } + + // Detect the Linux distribution + distro := detectDistro() + if distro == "" { + fmt.Println("Unable to detect Linux distribution.") + return + } + + fmt.Printf("Detected distribution: %s\n", distro) + + // Get the list of installed packages for the detected distro + packages, err := getPackageList(distro) + if err != nil { + fmt.Println("Error:", err) + return + } + + // Print the installed packages + fmt.Println("Installed Packages:") + for _, pkg := range packages { + if pkg != "" { + fmt.Println(pkg) + } + } + go NewWatchdog() startHTTP() -- cgit v1.2.3