Skip to content

Instantly share code, notes, and snippets.

@JamesMGreene
Created October 29, 2013 19:24
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JamesMGreene/7220962 to your computer and use it in GitHub Desktop.
Save JamesMGreene/7220962 to your computer and use it in GitHub Desktop.
Sub-Gruntfile explanation

Picture a [non-modular] folder structure like this:

root/
 - Gruntfile.js
 - node_modules/
 - Platform/
    - Gruntfile.js
    - ...
 - Products/
    - ProductA/
       - Gruntfile.js
       - ...
    - ProductB/
       - Gruntfile.js
       - ...
    - ...

From the root dir's Gruntfile.js, I effectively want to delegate out to the sub-Gruntfile.js under the Platform dir and each of the Product dirs.

Pseudo-coded desired action:

glob(["Platform/Gruntfile.js", "Products/*/Gruntfile.js"], function(err, results) {
  results.forEach(function(gruntfile) {
    grunt.run(gruntfile);
  });
});
@naugtur
Copy link

naugtur commented Dec 10, 2013

+1

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