]> git.ipfire.org Git - thirdparty/moment.git/commitdiff
fix concatlang taks
authorIgor Lima <igor.lima@evolut.io>
Tue, 19 Feb 2013 19:59:30 +0000 (16:59 -0300)
committerIgor Lima <igor.lima@evolut.io>
Tue, 19 Feb 2013 19:59:30 +0000 (16:59 -0300)
Gruntfile.js
package.json
tasks/concat-lang.js

index 21ed6ee067aeb9fe9eb4612ad586f85c63021e38..c767a92b600666573733ca623e23c7efa89ea44d 100644 (file)
@@ -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']);
index 5b38ea24076d1b6e8b5485005918e201dd733363..5ba43f7a74da63d41993adf334d7a90df14db88e 100755 (executable)
     "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"
index ec29298a25bb825e16c0ab464b4d23222aa1a674..c7c12d810e4cf479cd653aa3bde21c5b2a3a13d2 100644 (file)
@@ -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) {