diff options
| author | Jeff Carr <[email protected]> | 2025-10-19 02:55:45 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-10-19 02:55:45 -0500 |
| commit | f9a62d1c3aeb9e99214cc16a664705d9a517fac3 (patch) | |
| tree | c0c2dc5199b9388669f6509419a0b93ae054b371 /subCommand.go | |
| parent | 3a7d5a176350447cf568d9fbc7ea804895549968 (diff) | |
make doTestVersion()
Diffstat (limited to 'subCommand.go')
| -rw-r--r-- | subCommand.go | 96 |
1 files changed, 96 insertions, 0 deletions
diff --git a/subCommand.go b/subCommand.go new file mode 100644 index 0000000..fd75fc2 --- /dev/null +++ b/subCommand.go @@ -0,0 +1,96 @@ +// Copyright 2017-2025 WIT.COM Inc. All rights reserved. +// Use of this source code is governed by the GPL 3.0 + +package main + +import ( + "go.wit.com/lib/protobuf/filepb" + "go.wit.com/log" +) + +func subCommand() (string, error) { + // Standard subcommand handling starts here + var s string + var err error + + if argv.Upgrade != nil { + doUpgrade() + me.argv.GoodExit("") + } + + if argv.Linux != nil { + if argv.Linux.Rdate != nil { + s, err = doRdate() + } else { + setTerminalTitle("pinging google", "ping", []string{"google.com"}) + } + } + + if argv.Build != nil { + s, err = doBuild() + } + + if argv.Test != nil { + s, err = doTest() + } + + if argv.Git != nil { + initMachine() + s, err = doGit() + } + + if argv.PB != nil { + pbuuid, pbver, pberr := filepb.IdentifyPB(argv.PB.Identify) + if pberr == nil { + log.Info("pb version is:", pbver) + log.Info("pb uuid is:", pbuuid) + s = "pb identify worked" + } else { + s = "identify failed" + err = pberr + } + } + + if argv.Clone != nil { + doClone() + me.argv.GoodExit("") + } + + if argv.WITCOM { + doWITCOM() + me.argv.GoodExit("") + } + + if argv.Clone != nil { + doClone() + me.argv.GoodExit("") + } + + if argv.WITCOM { + doWITCOM() + me.argv.GoodExit("") + } + + if argv.Upgrade != nil { + doUpgrade() + } + + if argv.Droplet != nil { + s, err = doDroplet() + } + + if argv.Publish != nil { + if err := doPublish(); err != nil { + me.argv.BadExit("doPublish failed", err) + } + me.argv.GoodExit("") + } + + if argv.Zoo != nil { + if areSuperuser() { + exitOnErrorRealtime([]string{"journalctl", "-n", "100", "-f", "_SYSTEMD_UNIT=zood.service"}) + } + me.argv.GoodExit("do something here") + } + return s, err +} |
