From 448066f2a3a211ebaffe5510c35eba5a31b51f70 Mon Sep 17 00:00:00 2001 From: Iskren Chernev Date: Tue, 29 Jul 2014 21:36:30 -0700 Subject: [PATCH] Add package_json grunt task to update package.json package.json contains a list of locale files, that was manually updated until now. This PR adds a grunt task to update package.json and registers it to run on release. fixes #1766 --- Gruntfile.js | 2 +- tasks/package_json.js | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 tasks/package_json.js diff --git a/Gruntfile.js b/Gruntfile.js index b4537929d..05785cded 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -216,6 +216,6 @@ module.exports = function (grunt) { // Task to be run when releasing a new version grunt.registerTask('release', [ 'jshint', 'nodeunit', 'concat', 'embedLocales', - 'component', 'uglify' + 'component', 'package_json', 'uglify' ]); }; diff --git a/tasks/package_json.js b/tasks/package_json.js new file mode 100644 index 000000000..9f3d1df29 --- /dev/null +++ b/tasks/package_json.js @@ -0,0 +1,9 @@ +module.exports = function (grunt) { + grunt.registerTask('package_json', function () { + var config = JSON.parse(grunt.file.read('package.json')); + + config.spm.output = grunt.file.expand('locale/*.js'); + + grunt.file.write('package.json', JSON.stringify(config, true, 4) + '\n'); + }); +} -- 2.47.3