summaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-01-20 01:40:14 -0600
committerJeff Carr <[email protected]>2025-01-20 01:40:14 -0600
commitfb372aad6f0cca032c1ed7577cd7747b4daca7fb (patch)
tree32dd9c7e763a1b3241518db4f80bb29479e41a69 /main.go
parent96f2795bf3a96bdc9929ea1015590bb4695c4de0 (diff)
code rearangev0.0.18v0.0.17
Diffstat (limited to 'main.go')
-rw-r--r--main.go26
1 files changed, 2 insertions, 24 deletions
diff --git a/main.go b/main.go
index b741233..7c52b7d 100644
--- a/main.go
+++ b/main.go
@@ -55,33 +55,11 @@ func main() {
}
if argv.Upgrade != nil {
- if argv.DryRun {
- log.Info("--dry-run", []string{"apt", "update"})
- } else {
- result := shell.Run([]string{"apt", "update"})
- if result.Error != nil {
- log.Info("apt update error:", result.Error)
- badExit(result.Error)
- }
- }
-
- fmt.Println("Installed Packages:")
- loop := me.forge.Machine.Wit.SortByName()
- for loop.Scan() {
- p := loop.Next()
- // log.Info("apt install", name)
- if me.forge.Machine.IsInstalled(p.Name) {
- if argv.DryRun {
- log.Info("--dry-run", []string{"apt", "install", p.Name})
- } else {
- shell.RunRealtime([]string{"apt", "install", p.Name})
- }
- }
- }
- okExit("installed")
+ doAptUpgrade()
}
if argv.ListPkgs != nil {
+ doAptList()
log.DaemonMode(true)
defer log.DaemonMode(false)
fmt.Println("Installed Packages:")