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

Environment variables are available in npm start scripts. #25

Closed
wants to merge 1 commit into from

Conversation

shinout
Copy link

@shinout shinout commented May 13, 2016

fix #24

Args with '=' are regarded as declaration of environment variables until one without '=' appears.

ABC=xxx XYZ=123 node server.js abc=xxx
#   |     |      |       |      |  
#   |     |      |     command-args
#   env-vars  command

PATH: './node_modules/.bin:' + process.env.PATH,
};

while (commandArgs.length && commandArgs[0].match('=')) {
Copy link
Member

Choose a reason for hiding this comment

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

This means that the command in the start script overrides the things above, I don't think that's intended behavior.

@shinout
Copy link
Author

shinout commented May 14, 2016

OK, I'll resend PR.

@shinout shinout force-pushed the env-vars-in-start branch from 2a9d8c5 to 3289868 Compare May 14, 2016 01:11
@shinout
Copy link
Author

shinout commented May 17, 2016

@jkrems Hi, what do you think of this?

@shinout shinout closed this Jun 6, 2016
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.

failed with npm start command with environment variables
2 participants