diff options
author | mjarkk <mkopenga@gmail.com> | 2018-12-12 22:10:33 +0100 |
---|---|---|
committer | mjarkk <mkopenga@gmail.com> | 2018-12-12 22:11:31 +0100 |
commit | 5d038dfd334d4bdd767ac4db504a21160a013f79 (patch) | |
tree | e27a87e61cd385a0e2be18b2c69cfd65088eceac /pkg/commands/os.go | |
parent | 0577d3b97fcedaf02b5aaa19ac29bdd082599209 (diff) |
Removed the wired error handling
Diffstat (limited to 'pkg/commands/os.go')
-rw-r--r-- | pkg/commands/os.go | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/pkg/commands/os.go b/pkg/commands/os.go index d40a60e46..827e6c420 100644 --- a/pkg/commands/os.go +++ b/pkg/commands/os.go @@ -59,7 +59,7 @@ func (c *OSCommand) RunCommandWithOutput(command string) (string, error) { } // RunCommandWithOutputLive runs RunCommandWithOutputLiveWrapper -func (c *OSCommand) RunCommandWithOutputLive(command string, output func(string) string) (errorMessage string, err error) { +func (c *OSCommand) RunCommandWithOutputLive(command string, output func(string) string) error { return RunCommandWithOutputLiveWrapper(c, command, output) } @@ -68,7 +68,7 @@ func (c *OSCommand) RunCommandWithOutputLive(command string, output func(string) // The ask argument will be "username" or "password" and expects the user's password or username back func (c *OSCommand) DetectUnamePass(command string, ask func(string) string) error { ttyText := "" - errMessage, err := c.RunCommandWithOutputLive(command, func(word string) string { + errMessage := c.RunCommandWithOutputLive(command, func(word string) string { ttyText = ttyText + " " + word prompts := map[string]string{ @@ -85,13 +85,7 @@ func (c *OSCommand) DetectUnamePass(command string, ask func(string) string) err return "" }) - if err != nil { - if strings.Contains("exit status 128", err.Error()) { - errMessage = "exit status 128" - } - return errors.New(errMessage) - } - return nil + return errMessage } // RunCommand runs a command and just returns the error |