HaxeFoundation / HaxeFoundation/haxe
Sys.command fails when using quotes
- Dominant language
- Haxe
- Stars
- 6.9k
- Forks
- 715
- Avg merge
- 2d 2h
- Merged PRs (30d)
- 11
Description
The following command fails for no reason:
```haxe
Sys.command(' "path/to/some.exe" --arg "quotedArgument" ');
```
This seems to be related to the presence of double-quotes around *both* exe path and argument.
**Workaround**: use `sys.io.Process`:
```haxe
var p = new sys.io.Process(' "path/to/some.exe" --arg "quotedArgument" '); // identical command
p.close();
```
For some reason, it seems like `Sys.command` implementation differs from `sys.io.Process` 🤔
Contributor guide
Research direction
Start by comparing the Sys.command and sys.io.Process entry points using the quoted command shown in the issue. Reproduce the failure and inspect why the two implementations handle quotes differently; done means the command with both a quoted executable path and quoted argument succeeds consistently.
Written by the indexing model from the issue text.
Assessment
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100