Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rye.shell does not setup the cmd field of the RAP out object #26

Open
rrepen opened this issue Oct 2, 2012 · 0 comments
Open

Rye.shell does not setup the cmd field of the RAP out object #26

rrepen opened this issue Oct 2, 2012 · 0 comments

Comments

@rrepen
Copy link

rrepen commented Oct 2, 2012

The RYE::SHELL has this code:
...
rap = Rye::Rap.new(self)
rap.add_stdout(stdout || '')
rap.add_stderr(stderr || '')
rap.add_exit_status($?)
rap
...

To get the cmd string back I have added the following two lines
...
cmd = Rye.prepare_command(cmd, args)
cmd_str = cmd.dup # Take a copy of the command before it gets the redirection part
cmd << " 2>#{tf.path}" # Redirect STDERR to file. Works in DOS too.
...
rap = Rye::Rap.new(self)
rap.add_stdout(stdout || '')
rap.add_stderr(stderr || '')
rap.add_exit_status($?)
rap.cmd = cmd_str # Add the cmd string to the RAP object
rap

By doing this I get back the command string and I have the same behavior as using a the Rye::Box

René

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant