summaryrefslogtreecommitdiff
path: root/doCheckout.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-02-09 02:22:22 -0600
committerJeff Carr <[email protected]>2025-02-09 02:22:22 -0600
commit5171aca31fc459b238e8a751375d14d3b8184bc0 (patch)
treefa2544b2fc1d1870b6028ff86462e6d658c955ea /doCheckout.go
parentd7d2e0ba1b00388579668034cf355c1dad22f9e1 (diff)
doCheckout() shared between GUI and command line
Diffstat (limited to 'doCheckout.go')
-rw-r--r--doCheckout.go47
1 files changed, 33 insertions, 14 deletions
diff --git a/doCheckout.go b/doCheckout.go
index c77c336..0d50f22 100644
--- a/doCheckout.go
+++ b/doCheckout.go
@@ -250,43 +250,62 @@ func doAllCheckoutMaster() error {
return nil
}
-// trys to figure out if there is still something to update
-// todo: redo this logic as it is terrible
-
-func doCheckout() error {
- if argv.Checkout.User != nil {
+// shared this with the GUI and the command line?
+func doCheckoutShared() error {
+ if me.argvCheckoutUser {
if argv.Force {
// make the user directories
if err := makeUserBranches(); err != nil {
- badExit(err)
+ return err
}
- okExit("make user branches done")
+ return nil
}
// this uses rill and is super fast
doAllCheckoutUser()
- okExit("")
+ return nil
}
- if argv.Checkout.Devel != nil {
+ if me.argvCheckoutDevel {
if argv.Force {
// make the devel directories
if err := makeDevelBranches(); err != nil {
- badExit(err)
+ return err
}
- okExit("make devel branches done")
+ return nil
}
// this uses rill and is super fast
doAllCheckoutDevel()
- okExit("")
+ return nil
}
- if argv.Checkout.Master != nil {
+ if me.argvCheckoutMaster {
doAllCheckoutMaster()
- okExit("")
}
return nil
}
+// trys to figure out if there is still something to update
+// todo: redo this logic as it is terrible
+
+func doCheckout() error {
+ if argv.Checkout.User != nil {
+ me.argvCheckoutUser = true
+ }
+
+ if argv.Checkout.Devel != nil {
+ me.argvCheckoutDevel = true
+ }
+
+ if argv.Checkout.Master != nil {
+ me.argvCheckoutMaster = true
+ }
+ if err := doCheckoutShared(); err != nil {
+ badExit(err)
+ }
+ okExit("git checkout done")
+ return nil
+}
+
func makeDevelBranches() error {
all := me.forge.Repos.SortByFullPath()
for all.Scan() {