sync-versions.js 746 Bytes
Newer Older
nabil el mahiri committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31


module.exports = function(grunt) {

    // Please see the Grunt documentation for more information regarding task
  // creation: http://gruntjs.com/creating-tasks

  grunt.registerTask('pinedev', 'The best Grunt plugin ever.', function() {
    
    var main =  grunt.file.readJSON('./package.json');

    grunt.log.writeln('main',main.dependencies)

    grunt.file.expand('node_modules/*/package.json')
    .map(function(filepath) {
      return grunt.file.readJSON(filepath);
    })
    .filter(function(pkg) {
      return (pkg.keywords && pkg.keywords.indexOf('pine') >= 0) 
    })
    .forEach(function(pkg) {

      main.dependencies[pkg.name] = '~' + pkg.version
    }, {});

    grunt.log.writeln('main',main.dependencies)

    
  });

}