fix(loaders/file.go): changed to ignore stderr when loading git status

This commit is contained in:
Ryooooooga 2022-08-02 08:32:28 +09:00
parent f23547580a
commit 438038a4f1
No known key found for this signature in database
GPG key ID: 07CF200DFCC20C25
5 changed files with 64 additions and 1 deletions

View file

@ -22,6 +22,8 @@ type ICmdObj interface {
Run() error
// runs the command and returns the output as a string, and an error if any
RunWithOutput() (string, error)
// runs the command and returns stdout and stderr as a string, and an error if any
RunWithOutputs() (string, string, error)
// runs the command and runs a callback function on each line of the output. If the callback returns true for the boolean value, we kill the process and return.
RunAndProcessLines(onLine func(line string) (bool, error)) error
@ -162,6 +164,10 @@ func (self *CmdObj) RunWithOutput() (string, error) {
return self.runner.RunWithOutput(self)
}
func (self *CmdObj) RunWithOutputs() (string, string, error) {
return self.runner.RunWithOutputs(self)
}
func (self *CmdObj) RunAndProcessLines(onLine func(line string) (bool, error)) error {
return self.runner.RunAndProcessLines(self, onLine)
}