pure/tasks/bower_json.js

19 lines
603 B
JavaScript
Raw Normal View History

2014-02-05 17:52:39 +00:00
'use strict';
var path = require('path');
2014-02-05 17:52:39 +00:00
module.exports = function (grunt) {
grunt.registerMultiTask('bower_json', 'Modifies bower.json file.', function (target) {
var values = this.data.values;
Object.keys(values).forEach(function (key) {
grunt.config.set('bower.' + key, values[key]);
grunt.log.writeln('Updated Bower ' +
String(key).cyan + ': ' + String(values[key]).cyan);
});
grunt.file.write(path.join(this.data.dest, 'bower.json'),
JSON.stringify(grunt.config('bower'), null, ' '));
2014-02-05 17:52:39 +00:00
});
};