Created
October 22, 2013 14:30
-
-
Save szimmers/7101729 to your computer and use it in GitHub Desktop.
example grunt file for running tasks in subdirectories, each which have their own grunt file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = function(grunt) { | |
grunt.registerTask('buildapp', function(dir) { | |
var done = this.async(); | |
grunt.log.writeln('processing ' + dir); | |
grunt.util.spawn({ | |
grunt: true, | |
args:['jshint', 'build', 'test', 'deploy'], | |
opts: { | |
cwd: dir | |
} | |
}, | |
function(err, result, code) { | |
if (err == null) { | |
grunt.log.writeln('processed ' + dir); | |
done(); | |
} | |
else { | |
grunt.log.writeln('processing ' + dir + ' failed: ' + code); | |
done(false); | |
} | |
}) | |
}); | |
grunt.registerTask('build', function() { | |
grunt.task.run(['buildapp:apps/framework']); | |
grunt.task.run(['buildapp:apps/foo']); | |
}); | |
grunt.registerTask('default', ['build']); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "foosuite", | |
"version": "0.0.0", | |
"dependencies": {}, | |
"devDependencies": { | |
"grunt": "~0.4.1", | |
"grunt-cli": "~0.1.9" | |
}, | |
"engines": { | |
"node": ">=0.8.0" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment