diff --git a/pkg/engine/cmd.go b/pkg/engine/cmd.go index c3fe9751..65c249b4 100644 --- a/pkg/engine/cmd.go +++ b/pkg/engine/cmd.go @@ -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" { diff --git a/pkg/tests/runner_test.go b/pkg/tests/runner_test.go index a67491b7..666eca03 100644 --- a/pkg/tests/runner_test.go +++ b/pkg/tests/runner_test.go @@ -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) -} diff --git a/pkg/tests/testdata/TestShlex/test.gpt b/pkg/tests/testdata/TestShlex/test.gpt deleted file mode 100644 index dc635e09..00000000 --- a/pkg/tests/testdata/TestShlex/test.gpt +++ /dev/null @@ -1,2 +0,0 @@ - -#!/usr/bin/env echo ${ARGS} \ No newline at end of file