Skip to content

Commit

Permalink
Reverted changes on command parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
VenkatRamaraju committed Jul 31, 2020
1 parent 05e3a44 commit 8303ef9
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions internal/ansible/runner/internal/inputdir/inputdir.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,12 @@ func (i *InputDir) Write() error {
return err
}

argValue := i.CmdLine
argValue = strings.TrimLeft(argValue, "'")
argValue = strings.TrimRight(argValue, "'")
// Trimming off the first and last characters if the command is wrapped by single quotations
if strings.HasPrefix(i.CmdLine, string("'")) && i.CmdLine[0] == i.CmdLine[len(i.CmdLine)-1] {
i.CmdLine = i.CmdLine[1 : len(i.CmdLine)-1]
}

cmdLineBytes := []byte(argValue)
cmdLineBytes := []byte(i.CmdLine)
if len(cmdLineBytes) > 0 {
err = i.addFile("env/cmdline", cmdLineBytes)
if err != nil {
Expand Down

0 comments on commit 8303ef9

Please sign in to comment.