summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-10-02 21:24:48 -0500
committerJeff Carr <[email protected]>2025-10-02 21:24:48 -0500
commit01fa86c6f69dc7f34b92f98c0d45ff93c324da9f (patch)
tree2212880f36312e23ee57f08839764f969d51c851
parent8ff037f0191a0034115a0eada3c8d9ed9557538f (diff)
stuff
-rw-r--r--doUpgrade.go14
1 files changed, 12 insertions, 2 deletions
diff --git a/doUpgrade.go b/doUpgrade.go
index 8c271b2..1938900 100644
--- a/doUpgrade.go
+++ b/doUpgrade.go
@@ -9,6 +9,7 @@ import (
"go.wit.com/lib/gui/shell"
"go.wit.com/lib/protobuf/zoopb"
+ "go.wit.com/log"
)
// exits if not root
@@ -18,16 +19,25 @@ func checkSuperuser() {
}
}
+func exitOnError(cmd []string) {
+ var err error
+ log.Info("Running:", cmd)
+ _, err = shell.RunVerbose(cmd)
+ if err != nil {
+ badExit(err)
+ }
+}
+
func doUpgrade() error {
var cmd []string
checkSuperuser()
cmd = []string{"apt", "update"}
- shell.RunVerbose(cmd)
+ exitOnError(cmd)
cmd = []string{"apt", "install", "wit-tools"}
- shell.RunVerbose(cmd)
+ exitOnError(cmd)
me.machine, _ = zoopb.InitMachine()
doAptUpgrade()