-
-
Notifications
You must be signed in to change notification settings - Fork 163
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
Fix command spawning when spaces occur in the path #520
Conversation
This may need a slightly diffferent approach to not break on Windows. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work!
This is ready for review. |
@olleolleolle ok to merge? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I asked a question about the SimpleDelegator but other than that, I’m very pleased with the readability of this change.
@@ -11,13 +11,18 @@ module Platforms | |||
# @private | |||
class WindowsCommandString < SimpleDelegator | |||
def initialize(cmd) | |||
__setobj__ format('%s /c "%s"', Aruba.platform.which('cmd.exe'), cmd) | |||
__setobj__ cmd |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the default right? No explicit need to implement the constructor?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You may be right. I'll take a look.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it is no longer needed. I removed it.
Summary
There was a bug in how
ChildProcess.build
was called. This PR fixes this.Details
Calling
#to_a
was called on UnixCommandString representing the executable, splitting the name unnecessarily.Motivation and Context
See #490.
How Has This Been Tested?
A spec was added for this. This still needs to be tested on Windows.
Types of changes
Checklist: