mirror of
https://github.com/Jguer/yay.git
synced 2024-11-06 09:07:21 +01:00
fix(parser): use Fields instead of Split
This commit is contained in:
parent
81b5feb68a
commit
55a6767b44
@ -37,7 +37,9 @@ func (r *OSRunner) Capture(cmd *exec.Cmd, timeout int64) (stdout, stderr string,
|
||||
cmd.Stderr = &errbuf
|
||||
err = cmd.Start()
|
||||
if err != nil {
|
||||
return "", "", err
|
||||
stdout = strings.TrimSpace(outbuf.String())
|
||||
stderr = strings.TrimSpace(errbuf.String())
|
||||
return stdout, stderr, err
|
||||
}
|
||||
|
||||
if timeout != 0 {
|
||||
@ -54,12 +56,13 @@ func (r *OSRunner) Capture(cmd *exec.Cmd, timeout int64) (stdout, stderr string,
|
||||
if timeout != 0 {
|
||||
timer.Stop()
|
||||
}
|
||||
if err != nil {
|
||||
return "", "", err
|
||||
}
|
||||
|
||||
stdout = strings.TrimSpace(outbuf.String())
|
||||
stderr = strings.TrimSpace(errbuf.String())
|
||||
if err != nil {
|
||||
return stdout, stderr, err
|
||||
}
|
||||
|
||||
if timedOut {
|
||||
err = fmt.Errorf("command timed out")
|
||||
}
|
||||
|
@ -21,7 +21,9 @@ func (c *CmdBuilder) BuildGitCmd(dir string, extraArgs ...string) *exec.Cmd {
|
||||
args = append(args, "-C", dir)
|
||||
}
|
||||
|
||||
args = append(args, extraArgs...)
|
||||
if len(extraArgs) > 0 {
|
||||
args = append(args, extraArgs...)
|
||||
}
|
||||
|
||||
cmd := exec.Command(c.GitBin, args...)
|
||||
cmd.Env = append(os.Environ(), "GIT_TERMINAL_PROMPT=0")
|
||||
@ -36,7 +38,9 @@ func (c *CmdBuilder) BuildMakepkgCmd(dir string, extraArgs ...string) *exec.Cmd
|
||||
args = append(args, "--config", c.MakepkgConfPath)
|
||||
}
|
||||
|
||||
args = append(args, extraArgs...)
|
||||
if len(extraArgs) > 0 {
|
||||
args = append(args, extraArgs...)
|
||||
}
|
||||
|
||||
cmd := exec.Command(c.MakepkgBin, args...)
|
||||
cmd.Dir = dir
|
||||
|
@ -817,8 +817,8 @@ func (a *Arguments) ParseCommandLine(config *Configuration) error {
|
||||
}
|
||||
|
||||
a.extractYayOptions(config)
|
||||
config.Runtime.CmdBuilder.MakepkgFlags = strings.Split(config.MFlags, " ")
|
||||
config.Runtime.CmdBuilder.GitFlags = strings.Split(config.GitFlags, " ")
|
||||
config.Runtime.CmdBuilder.MakepkgFlags = strings.Fields(config.MFlags)
|
||||
config.Runtime.CmdBuilder.GitFlags = strings.Fields(config.GitFlags)
|
||||
return nil
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user