Change customCommand fields to pointers

This allows us to tell whether they appear in the user's config file, which we
will need later in this branch.
This commit is contained in:
Stefan Haller 2025-02-24 08:46:55 +01:00
parent 0df5e08828
commit f93948cb23
4 changed files with 16 additions and 11 deletions

View file

@ -261,7 +261,7 @@ func (self *HandlerCreator) finalHandler(customCommand config.CustomCommand, ses
cmdObj := self.c.OS().Cmd.NewShell(cmdStr)
if customCommand.Subprocess {
if customCommand.Subprocess != nil && *customCommand.Subprocess {
return self.c.RunSubprocessAndRefresh(cmdObj)
}
@ -273,7 +273,7 @@ func (self *HandlerCreator) finalHandler(customCommand config.CustomCommand, ses
return self.c.WithWaitingStatus(loadingText, func(gocui.Task) error {
self.c.LogAction(self.c.Tr.Actions.CustomCommand)
if customCommand.Stream {
if customCommand.Stream != nil && *customCommand.Stream {
cmdObj.StreamOutput()
}
output, err := cmdObj.RunWithOutput()
@ -283,14 +283,14 @@ func (self *HandlerCreator) finalHandler(customCommand config.CustomCommand, ses
}
if err != nil {
if customCommand.After.CheckForConflicts {
if customCommand.After != nil && customCommand.After.CheckForConflicts {
return self.mergeAndRebaseHelper.CheckForConflicts(err)
}
return err
}
if customCommand.ShowOutput {
if customCommand.ShowOutput != nil && *customCommand.ShowOutput {
if strings.TrimSpace(output) == "" {
output = self.c.Tr.EmptyOutput
}