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

Scripting Grunt-Init #64

Open
mkroehnert opened this issue Nov 24, 2013 · 7 comments
Open

Scripting Grunt-Init #64

mkroehnert opened this issue Nov 24, 2013 · 7 comments
Labels

Comments

@mkroehnert
Copy link

Bower supports usage through a public API.
It would be great to have the same capabilities for grunt-init.
I would like to use grunt-init from inside another program which would include enhancing the search path for template directories.

@auscaster
Copy link

@vladikoff this should be pretty straight forward. Is there anything preventing this, and is it something you would like to incorporate?

@vladikoff
Copy link
Member

@sourcey feel free to experiment with stuff!

@auscaster
Copy link

It seems like the only thing preventing this is that grunt.js needs to expose a runTasks method or similar which can be called programatically... I'll investigate further...

@auscaster
Copy link

Created new issue and PR via gruntjs/grunt#1108

@mkroehnert
Copy link
Author

Hi @auscaster,
thank you very much for working on this issue.

I had a look at the pull request you opened but did not fully understand how it would work with using grunt-init from within JS programs.
Since I I'd like to prevent you from doing unnecessary work and to clarify what I had in mind I created a code snippet of how I would like to use grunt-init in a custom project:

var gruntInit = require('grunt-init');

gruntInit.init('template-name', { template-path: 'path/to/custom/location', otherParameter: value } )
.on('end', function (installed) {
    console.log(installed);
});

The .on('end', ...) stuff is taken from the bower example but something similar might be helpful.

@auscaster
Copy link

@mkroehnert it seems like I misunderstood the exact issue you were talking about, but all was not in vain since I was able to get grunt to work directly from JS whereas before it wouldn't. Anyway thanks for clarifying the issue, and I'll take another look when time permits.

@mkroehnert
Copy link
Author

@auscaster no problem.
Upon second look I got what your proposed patch is about.
It seems like this is also a nice addition to Grunt itself.

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

No branches or pull requests

3 participants