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

grunt ENV config #4

Closed
drkibitz opened this issue Dec 13, 2012 · 2 comments
Closed

grunt ENV config #4

drkibitz opened this issue Dec 13, 2012 · 2 comments

Comments

@drkibitz
Copy link

I was looking through the source and saw this line:

var context = _.extend({},defaultEnv,process.env)

Though defaultEnv doesn't seem exposed in any way. I would love to be able to override process.env variables with properties set within my grunt file, or even define my own context, maybe something like:

var context = this.data.context || _.extend({},defaultEnv,process.env)
if (this.data.env) _.extend(context, this.data.env);

Using grunt these of course can be expanded json file directives, and things get much more flexible.

@drkibitz
Copy link
Author

Would also like to get at the current grunt process task as well, maybe?

var context = this.data.context || _.extend({TARGET: this.target}, process.env)

@jsoverson
Copy link
Owner

Thanks for the comments, @drkibitz, we also made grunt-env which allows you to specify ENV variables in your Gruntfile, works well with this task

https://github.com/onehealth/grunt-env

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

No branches or pull requests

2 participants