Skip to content

Commit d4db546

Browse files
author
fabiantheblind
committed
Added grunt-update-json for updating bower.json
Could be added to build or release process
1 parent cf15a54 commit d4db546

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

Gruntfile.js

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,20 @@ module.exports = function(grunt) {
4848
}
4949
},
5050
},
51+
update_json: {
52+
// set some task-level options
53+
options: {
54+
src: 'package.json',
55+
indent: '\t'
56+
},
57+
// update bower.json with data from package.json
58+
bower: {
59+
src: 'package.json', // where to read from
60+
dest: 'bower.json', // where to write to
61+
// the fields to update, as a String Grouping
62+
fields: 'name version description repository'
63+
},
64+
},
5165
requirejs: {
5266
unmin: {
5367
options: {
@@ -177,7 +191,7 @@ module.exports = function(grunt) {
177191
options: {
178192
github: {
179193
repo: 'lmccart/p5.js', //put your user/repo here
180-
usernameVar: process.env.GITHUB_USERNAME, //ENVIRONMENT VARIABLE that contains Github username
194+
usernameVar: process.env.GITHUB_USERNAME, //ENVIRONMENT VARIABLE that contains Github username
181195
passwordVar: process.env.GITHUB_PASSWORD //ENVIRONMENT VARIABLE that contains Github password
182196
}
183197
}
@@ -192,7 +206,7 @@ module.exports = function(grunt) {
192206
grunt.loadNpmTasks('grunt-contrib-yuidoc');
193207
grunt.loadNpmTasks('grunt-contrib-sass');
194208
grunt.loadNpmTasks('grunt-release');
195-
209+
grunt.loadNpmTasks('grunt-update-json');
196210
grunt.registerTask('test', ['jshint', 'mocha']);
197211
grunt.registerTask('yui', ['yuidoc']);
198212
grunt.registerTask('default', ['jshint', 'requirejs', 'mocha']);

0 commit comments

Comments
 (0)