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

lineman config --process does not process object keys #324

Open
tandrewnichols opened this issue Sep 24, 2014 · 4 comments
Open

lineman config --process does not process object keys #324

tandrewnichols opened this issue Sep 24, 2014 · 4 comments

Comments

@tandrewnichols
Copy link

The --process flag on the lineman config command is a great tool, but it only expands values in the config, but leaves keys untouched, so you end up with output that looks like:

  "<%= files.less.generated %>": "app/css/main.less"

Seems like --process should do the "dest" key too.

@searls
Copy link
Member

searls commented Sep 24, 2014

Yeah, I'm not entirely sure how it would interpolate keys. Maybe look into a PR?

On Wed, Sep 24, 2014 at 10:26 AM, Andrew Nichols [email protected]
wrote:

The --process flag on the lineman config command is a great tool, but it only expands values in the config, but leaves keys untouched, so you end up with output that looks like:

  "<%= files.less.generated %>": "app/css/main.less"

Seems like --process should do the "dest" key too.

Reply to this email directly or view it on GitHub:
#324

@jasonkarns
Copy link
Member

Interesting. I assume we're using grunt.config.process under the covers?
http://gruntjs.com/api/grunt.config#grunt.config.process

If so, does grunt.contrib.process not already expand keys itself?

@tandrewnichols
Copy link
Author

If you're using underscore or lodash templating (and I assume you are), seems like you should be able to do the entire config object as a json string, rather than each key individually.

But this might be naive; I have not looked at all at how that lineman config is built. But presumably, once you compile the object, you could do something like:

console.log(_.template(JSON.stringify(configObj, null, 2), filesObj));

Again, that's probably oversimplified, but that's probably roughly what I'd try for.

But per @jasonkarns point, if you're using something else, maybe this doesn't work. Doesn't seem like it would be hard to do it yourself, though.

@davemo
Copy link
Member

davemo commented Sep 24, 2014

I started working on something similar here: cc4899a but never ended up going further with it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants