From: Igor Lima Date: Tue, 19 Feb 2013 19:59:30 +0000 (-0300) Subject: fix concatlang taks X-Git-Tag: 2.1.0~55^2~3^2^2~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ad9e2f0c1bc66ab65e17ff60afe9002ac2a7fefe;p=thirdparty%2Fmoment.git fix concatlang taks --- diff --git a/Gruntfile.js b/Gruntfile.js index 21ed6ee06..c767a92b6 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -25,6 +25,12 @@ module.exports = function (grunt) { dest: 'min/langs.js' } }, + concatlang : { + langs: { + src: ['lang/*.js'], + dest: 'min/langs.js' + } + }, uglify : { my_target: { files: minifiedFiles @@ -94,6 +100,7 @@ module.exports = function (grunt) { grunt.loadNpmTasks('grunt-contrib-jshint'); grunt.loadNpmTasks('grunt-contrib-concat'); grunt.loadNpmTasks('grunt-contrib-uglify'); + grunt.loadNpmTasks('grunt-contrib-watch'); // Default task. grunt.registerTask('default', ['jshint', 'nodeunit']); diff --git a/package.json b/package.json index 5b38ea240..5ba43f7a7 100755 --- a/package.json +++ b/package.json @@ -38,10 +38,12 @@ "devDependencies" : { "uglify-js" : "1.3.4", "grunt" : "latest", - "grunt-contrib-jshint" : "latest", - "grunt-contrib-nodeunit" : "latest", - "grunt-contrib-concat" : "latest", - "grunt-contrib-uglify" : "latest" + "grunt-contrib-jshint" : "latest", + "grunt-contrib-nodeunit" : "latest", + "grunt-contrib-concat" : "latest", + "grunt-contrib-uglify" : "latest", + "grunt-contrib-watch" : "latest", + "grunt-lib-legacyhelpers" : "latest" }, "scripts": { "test": "grunt" diff --git a/tasks/concat-lang.js b/tasks/concat-lang.js index ec29298a2..c7c12d810 100644 --- a/tasks/concat-lang.js +++ b/tasks/concat-lang.js @@ -2,6 +2,7 @@ module.exports = function (grunt) { + var helpers = require('grunt-lib-legacyhelpers').init(grunt); var START = "(function(){\n"; var END = "})();\n"; @@ -27,16 +28,16 @@ module.exports = function (grunt) { ].join('\n'); grunt.registerMultiTask('concatlang', 'Concatenate files.', function() { - var files = grunt.file.expandFiles(this.file.src); + var files = grunt.file.expand(this.data.src); // Concat specified files. - var src = grunt.helper('concat', files, {separator: END + START}); - grunt.file.write(this.file.dest, wrapFile(src)); + var src = helpers.concat(files, {separator: END + START}); + grunt.file.write(this.data.dest, wrapFile(src)); // Fail task if errors were logged. if (this.errorCount) { return false; } // Otherwise, print a success message. - grunt.log.writeln('File "' + this.file.dest + '" created.'); + grunt.log.writeln('File "' + this.data.dest + '" created.'); }); function wrapFile(code) {