Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions pkg/engine/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,12 +211,6 @@ func (e *Engine) newCommand(ctx context.Context, extraEnv []string, tool types.T
cmdArgs = append(cmdArgs, f.Name())
}

// This is a bit hacky, but we want ARGS="x y" to expand to "x" and "y" not "x y" if used as arguments
cmdArgs, err = shlex.Split(strings.Join(cmdArgs, " "))
if err != nil {
return nil, nil, err
}

// This is a workaround for Windows, where the command interpreter is constructed with unix style paths
// It converts unix style paths to windows style paths
if runtime.GOOS == "windows" {
Expand Down
16 changes: 0 additions & 16 deletions pkg/tests/runner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -572,19 +572,3 @@ func TestExport(t *testing.T) {
require.NoError(t, err)
assert.Equal(t, "TEST RESULT CALL: 3", x)
}

func TestShlex(t *testing.T) {
runner := tester.NewRunner(t)

runner.RespondWith(tester.Result{
Func: types.CompletionFunctionCall{
Name: "transient",
},
})
x, err := runner.Run("", `{
"args":" x y z "
}`)
require.NoError(t, err)
// The fact the white space is all perfect means that the string didn't get passed as one arg but multiple
assert.Equal(t, "x y z\n", x)
}
2 changes: 0 additions & 2 deletions pkg/tests/testdata/TestShlex/test.gpt

This file was deleted.