Created
August 22, 2014 21:41
-
-
Save grayside/9d4cc1e4ed84b5a478f4 to your computer and use it in GitHub Desktop.
Expose all shellscripts in a bin/ directory suffixed .sh as grunt tasks
This file contains hidden or 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) { | |
/** | |
* Define "bin" wrapper tasks. | |
*/ | |
var files = grunt.file.expand("bin/*.sh"); | |
if (files) { | |
for (var f in files) { | |
var name = files[f].split('/').pop().split('.').shift(); | |
grunt.config(['shell', name], { | |
command: 'bash ' + files[f] | |
}); | |
grunt.registerTask(name, ['shell:' + name]); | |
} | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment