You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like to pass a single command (with its list of arguments) and let Rex figure out the quoting depending on where it gets executed.
For example:
I'd like to run the following command: run 'perl', [ '-e', 'print $ENV{VAR}' ]
which needs different quoting depending on the target operating system's environment:
Windows: perl -e "print $ENV{VAR}"
~non-Windows: perl -e 'print $ENV{VAR}'
Since we already use Net::OpenSSH::ShellQuoter with run(), I'd like it to recognize if the target system is Windows, and quote accordingly.
Perhals i_run(), i_exec(), and i_exec_nohup() could make use of the same idea too (now or later.)
Describe alternatives you have considered
Manually checking if the managed endpoints is Windows (for example while executing tests locally), and prepare slightly different versions of the same command.
Sometimes the test suite skips tests on Windows due to the difficulty.
The text was updated successfully, but these errors were encountered:
As
maintainer
I would like to
enable command argument quoting on Windows
so I can
avoid making special cases for tests and features on Windows
Additional context
I ran into this while working on #1632.
Describe the solution you would like
I'd like to pass a single command (with its list of arguments) and let Rex figure out the quoting depending on where it gets executed.
For example:
run 'perl', [ '-e', 'print $ENV{VAR}' ]
perl -e "print $ENV{VAR}"
perl -e 'print $ENV{VAR}'
Since we already use Net::OpenSSH::ShellQuoter with
run()
, I'd like it to recognize if the target system is Windows, and quote accordingly.Perhals
i_run()
,i_exec()
, andi_exec_nohup()
could make use of the same idea too (now or later.)Describe alternatives you have considered
Manually checking if the managed endpoints is Windows (for example while executing tests locally), and prepare slightly different versions of the same command.
Sometimes the test suite skips tests on Windows due to the difficulty.
The text was updated successfully, but these errors were encountered: