Description
Describe the enhancement
The current documentation of exec.exec does not mention the limitation
regarding single quotes and double quotes. In the current implementation,
only double quotes are supported for splitting arguments.
The documentation should be updated to include
this information to prevent confusion and save developers' time.
Current document on exec.exec
is as follows.
toolkit/packages/exec/src/exec.ts
Lines 7 to 16 in 4573039
* @param commandLine command to execute (can include additional args). Must be correctly escaped.
This lacks information on single quotes and double quotes, only the latter of which is supported currently. I would like to append the information on the doc.
Code Snippet
* @param commandLine command to execute (can include additional args). Must be correctly escaped. Currently, only double quotes are supported for splitting args.
Additional information
I spent many hours debugging the reason why the following code did not work as expected
exec.exec(`git config --local some.key 'some value with white space'`)
It is only after I read the internal code that I realized the root cause is the single quotes.
I believe the slight change on doc can prevent developers like me from failing into pitfalls.
toolkit/packages/exec/src/toolrunner.ts
Line 568 in 4573039