diff options
| author | Jeff Carr <[email protected]> | 2024-11-15 09:50:13 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-11-15 09:50:13 -0600 |
| commit | ea96d4880eedd92d9c8228b84de028185ec941b2 (patch) | |
| tree | 8c8f317c1ddca756e7c1bc12c132855e6d32833c /main.go | |
| parent | 7b069233955c6f35270f0cb2cb49bf6038c11020 (diff) | |
does apt_linux.go vs apt_windows.go work automagically?
Diffstat (limited to 'main.go')
| -rw-r--r-- | main.go | 25 |
1 files changed, 25 insertions, 0 deletions
@@ -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() |
