start moving commit panel handlers into controller

more

and more

move rebase commit refreshing into existing abstraction

and more

and more

WIP

and more

handling clicks

properly fix merge conflicts

update cheatsheet

lots more preparation to start moving things into controllers

WIP

better typing

expand on remotes controller

moving more code into controllers
This commit is contained in:
Jesse Duffield 2022-01-16 14:46:53 +11:00
parent a90b6efded
commit 1dd7307fde
104 changed files with 4980 additions and 4111 deletions

View file

@ -2,6 +2,7 @@ package oscommands
import (
"os/exec"
"sync"
)
// A command object is a general way to represent a command to be run on the
@ -50,6 +51,9 @@ type ICmdObj interface {
PromptOnCredentialRequest() ICmdObj
FailOnCredentialRequest() ICmdObj
WithMutex(mutex *sync.Mutex) ICmdObj
Mutex() *sync.Mutex
GetCredentialStrategy() CredentialStrategy
}
@ -70,6 +74,9 @@ type CmdObj struct {
// if set to true, it means we might be asked to enter a username/password by this command.
credentialStrategy CredentialStrategy
// can be set so that we don't run certain commands simultaneously
mutex *sync.Mutex
}
type CredentialStrategy int
@ -132,6 +139,16 @@ func (self *CmdObj) IgnoreEmptyError() ICmdObj {
return self
}
func (self *CmdObj) Mutex() *sync.Mutex {
return self.mutex
}
func (self *CmdObj) WithMutex(mutex *sync.Mutex) ICmdObj {
self.mutex = mutex
return self
}
func (self *CmdObj) ShouldIgnoreEmptyError() bool {
return self.ignoreEmptyError
}