Created
May 6, 2013 20:38
-
-
Save stevekane/5528003 to your computer and use it in GitHub Desktop.
load tasks straiught from package.json
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
fs = require('fs') | |
packageJSON = JSON.parse(fs.readFileSync(__dirname + '/package.json', 'utf-8')) | |
npmTasks = [] | |
deps = Object.keys(packageJSON.dependencies) + Object.keys(packageJSON.devDependencies) | |
for dep in deps | |
if dep.search('grunt-') isnt -1 then npmTasks.push(dep) | |
#DO YOUR NORMAL grunt stuff here until you get to the location where you load your Npm tasks | |
npmTasks.forEach( (task) -> | |
grunt.loadNpmTasks(task) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment