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

passing options instead of cb to spawnCommand #685

Merged
merged 1 commit into from Oct 27, 2014
Merged

Conversation

grawk
Copy link
Contributor

@grawk grawk commented Oct 24, 2014

I was puzzled by why 'cb' was being passed to the spawnCommand method. I assume this was a typo? With the proposed change, you can now pass in options to the spawned command in order to do things like modify the PATH variable for the spawn'd process, etc.

@SBoudrias
Copy link
Member

Mind adding unit test to make sure it doesn't break in the future.

@SBoudrias SBoudrias force-pushed the master branch 2 times, most recently from f7728bd to 9df7c62 Compare October 25, 2014 18:59
@grawk
Copy link
Contributor Author

grawk commented Oct 27, 2014

Thanks @SBoudrias I am looking and trying to figure out how the install.js unit tests work. Will update when I figure that out!

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 796c85a on grawk:master into * on yeoman:master*.

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling d635024 on grawk:master into * on yeoman:master*.

return asyncStub;
}.bind(this);
});

describe('#runInstall()', function () {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add an empty line between describe blocks.

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 39bef57 on grawk:master into * on yeoman:master*.

@grawk
Copy link
Contributor Author

grawk commented Oct 27, 2014

@SBoudrias I converted from using the commandsRun array to using simon.stub(). Is this what you had in mind? I haven't used sinon before but this is a good opportunity to learn.

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 9fd0d8b on grawk:master into * on yeoman:master*.

};
//args: installer, paths, options, cb
this.dummy.runInstall('nestedScript', ['path1', 'path2'], spawnEnv, done);
assert.ok(this.spawnCommandStub.calledWithExactly('nestedScript', ['install', 'path1', 'path2'], spawnEnv));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change every assertions to this structure: sinon.assert.calledWithExactly(this.spawnCommandStub, 'nestedScript', ['install', 'path1', 'path2'], spawnEnv)

@SBoudrias
Copy link
Member

You can see this page about sinon assertions

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 524bd41 on grawk:master into * on yeoman:master*.

@SBoudrias
Copy link
Member

Hey, that's perfect! Just squash you commits (with a useful commit message) and I'll merge!

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling efa7846 on grawk:master into * on yeoman:master*.

@grawk
Copy link
Contributor Author

grawk commented Oct 27, 2014

Sorry for additional churn on the commits. I'm learning how to "squash" them and causing Travis builds in the process

@coveralls
Copy link

Coverage Status

Coverage decreased (-1.83%) when pulling 6bd06eb on grawk:master into a0ae1f3 on yeoman:master.

@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling 6bd06eb on grawk:master into a0ae1f3 on yeoman:master.

@SBoudrias
Copy link
Member

Perfect, thanks a lot!

SBoudrias added a commit that referenced this pull request Oct 27, 2014
passing options instead of cb to spawnCommand
@SBoudrias SBoudrias merged commit 93cd69e into yeoman:master Oct 27, 2014
@grawk
Copy link
Contributor Author

grawk commented Oct 27, 2014

Thanks! Can you please let me know what the timeline would be for seeing this in a published release of the generator?

@SBoudrias
Copy link
Member

I'd say a couple weeks to a month. We're currently working toward 0.18 so we need to make some new feature more solid before we can consider a release.

When we're in patching mode release go out faster, you're just not falling in a good phase for path releases.

@grawk
Copy link
Contributor Author

grawk commented Oct 28, 2014

OK. That's good to know. Thanks. The reason I took this on to begin with is that my project's generator currently requires a globally installed bower instance in order to work. But we want to instead rely upon an internally require'd instance, which in turn requires modifying the PATH of the child process. In the meantime we will continue to document to our users that they should have globally installed bower. Looking forward to the release to remove that dependency upon our users :) Thanks again.

@grawk
Copy link
Contributor Author

grawk commented Oct 28, 2014

@SBoudrias upon further thinking on it, do you think it may make sense to eliminate bower as a global dependency at the generator level? I.e. modify the bowerInstall method to add a local bower instance to the PATH environment variable?

@SBoudrias
Copy link
Member

Maybe open another issue to discuss it. I'm not sure it's a good idea, but maybe the rest of the team have other opinions.

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

Successfully merging this pull request may close these issues.

None yet

3 participants