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

Set env variable immediately in cli #152

Merged
merged 2 commits into from Aug 12, 2014
Merged

Set env variable immediately in cli #152

merged 2 commits into from Aug 12, 2014

Conversation

@geek
Copy link
Member

geek commented Aug 11, 2014

Closes #151

@geek geek added this to the 4.0.2 milestone Aug 11, 2014
@geek geek added the bug label Aug 11, 2014
test/cli.js Outdated

it('changes the NODE_ENV based on -e param', function (done) {

var cli = ChildProcess.spawn('node', [labPath, 'test/cli/environment.js', '-e lab']);

This comment has been minimized.

Copy link
@arb

arb Aug 12, 2014

Contributor

Based on my experience, each argument should be another element in the array, ie
[labPath, 'test/cli/environment.js', '-e','lab']

@@ -16,7 +16,13 @@ describe('Test CLI', function () {

it('Node Environment defaults to test', function (done) {

expect(env).to.equal('test');
if (process.argv[3] && process.argv[3].indexOf('-e') === 0) {

This comment has been minimized.

Copy link
@arb

arb Aug 12, 2014

Contributor

Probably safer to check for >= 0 just in case.

@geek geek assigned arb Aug 12, 2014
arb added a commit that referenced this pull request Aug 12, 2014
Set env variable immediately in cli
@arb arb merged commit 5fed127 into hapijs:master Aug 12, 2014
1 check passed
1 check passed
continuous-integration/travis-ci The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.