-
Notifications
You must be signed in to change notification settings - Fork 14
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
vagrantutil: fix parseRecords for vagrant 1.8+ #5
Conversation
if data != "" { | ||
break | ||
} | ||
} |
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.
Can be simplified too:
if typeName == record[2] && record[3] != "" {
data = record[3]
break
}
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.
done
// startCommand starts the command and sends back both the stdout and stderr to | ||
// the returned channel. Any error happened during the streaming is passed to | ||
// the Error field. | ||
func startCommand(cmd *exec.Cmd) (<-chan *CommandOutput, error) { | ||
func (v *Vagrant) startCommand(cmd *exec.Cmd) (<-chan *CommandOutput, error) { |
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.
Same for this, no need to make it a method of *Vagrant
. It would make it easier to implement tests
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'd need to add another argument for logging the command's ouput - startCommand(cmd *exec.Cmd, log fn(string))
- is it worth it?
/cc @fatih @sent-hil