From: Brian Wyant Date: Sat, 14 Sep 2013 01:21:33 +0000 (-0400) Subject: Fix #1071 - allows embedding only one language X-Git-Tag: 2.3.0~49^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=104164cb8d59631068bfe970dc8402d580a72cfb;p=thirdparty%2Fmoment.git Fix #1071 - allows embedding only one language --- diff --git a/Gruntfile.js b/Gruntfile.js index 4bad9bd9e..3dc8b99e4 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -1,4 +1,18 @@ module.exports = function (grunt) { + + var embedOption = grunt.option('embed_languages'), + embedLanguageDest = embedOption ? + 'min/moment+customlangs.js' : + 'min/moment+langs.js', + embedLanguageLangs = 'lang/*.js'; + + if (embedOption && embedOption.match(/,/)) { + embedLanguageLangs = 'lang/{' + embedOption + '}.js'; + } + else if (embedOption) { + embedLanguageLangs = 'lang/' + embedOption + '.js'; + } + grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), concat : { @@ -78,12 +92,8 @@ module.exports = function (grunt) { }, embed_languages: { moment: 'moment.js', - dest: grunt.option('embed_languages') ? - 'min/moment+customlangs.js' : - 'min/moment+langs.js', - targetLangs: grunt.option('embed_languages') ? - 'lang/{' + grunt.option('embed_languages') + '}.js': - 'lang/*.js' + dest: embedLanguageDest, + targetLangs: embedLanguageLangs } });