Skip to content

Windows file paths that contain a space are not properly escaped #2255

@paddy667

Description

@paddy667

The file path of the --context flag contains a space. When I try to create a new Openshift component I get an error:

Error: accepts between 0 and 2 arg(s), received 4

Error message with examples removed:

Error occurred while creating Component 'test': Command failed: "c:\Users\<omitted>\.vscode\extensions\redhat.vscode-openshift-connector-0.2.10\out\tools\win32\odo.exe" create go test --registry=DefaultDevfileRegistry --context=c:\Users\<omitted>\OneDrive - git\Documents\git\test --app=test --project=default --starter=go-starter
Error: accepts between 0 and 2 arg(s), received 4
Usage:
  odo create <component_type> [component_name] [flags]

Examples:
  < omitted >

 X  accepts between 0 and 2 arg(s), received 4

This seems to be happening with Windows, I have not tested on a Linux distro. I think this can be replicated simply by deploying to a file location with a space in it.

In the command above I believe the part highlighted in bold is the issue: --context=c:\Users<omitted>\OneDrive - git\Documents\git\test

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions