summaryrefslogtreecommitdiff
path: root/doCheckout.go
diff options
context:
space:
mode:
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() {