gruntjs - Pass in param to 'Grunt watch' for directory -


i use grunt less>css, minification, , concatenation of css , js. wondering if it's possible pass in param when type in "grunt watch" directory watch. way can have multiple versions of site running off same gruntfile.

http://pastebin.com/b2fj74sc

you can use node's process.argv command line arguments.

the code below can called with: grunt watch --dir myfolder

grunt.registertask('watch', function() {     var args = process.argv;     var folder = args[args.indexof('--dir') + 1];     console.log('watch folder: ', folder); // "watch folder: myfolder" }); 

Comments

Popular posts from this blog

tcpdump - How to check if server received packet (acknowledged) -