Can't pass argument wrapped in single quotes to script run by cli-test-utils
#2204
Labels
bug
Something isn't working
priority-low
Legit issue but cosmetic or nice-to-have
severity-low
Bug that makes the usage of the Zowe less convenient but doesn't impact key use cases
Describe the bug
When invoking the
runCliScript
method from thecli-test-utils
SDK to run a Bash script, I am unable to pass arguments that must be wrapped in single quotes because the quotes get mangled.For example, when trying to pass a fully qualified dsname
IBMUSER.OPSREXX.PS
, it is common to wrap it in single quotes (e.g.,'IBMUSER.OPSREXX.PS'
) so that z/OS doesn't prepend the user HLQIBMUSER
.Note: This issue exists only on Windows.
Expected and actual results
For a minimal reproduction of the issue, I've used
child_process.spawnSync
which is the underlying function called byrunCliScript
.test-quotes.sh
test-quotes.js
Expected Behavior: The dsname should be printed verbatim with single quotes intact.
Actual Behavior: The script outputs the dsname with quotes stripped off. Is this a bug in Node.js?
The following workaround exists and could be documented, but is not very intuitive:
const dsname = `'\\'IBMUSER.OPSREXX.PS\\''`;
Describe your environment
zowe --version
): 8.0.0-next.202407181904zowe plugins list --short
): N/Anode --version
,npm --version
): Node 18.20.4, npm 10.7.0Additional context
CLI arg parsing may have changed between Zowe V2 and V3, since we updated to a new major version of
yargs-parser
- see yargs/yargs-parser#407The text was updated successfully, but these errors were encountered: