source: Dev/trunk/node_modules/grunt-exec/test/Gruntfile.js @ 533

Last change on this file since 533 was 516, checked in by hendrikvanantwerpen, 11 years ago

Enable deployment with Grunt.

File size: 1.2 KB
Line 
1module.exports = function(grunt) {
2  grunt.initConfig({
3    exec: {
4      test1: {
5        cmd: 'echo "bruce willis was dead" > test1'
6      }
7    , test2: {
8        cmd: function() { return 'echo "grunt@' + this.version + '" > test2'; }
9      }
10    , test3: {
11        cmd: function(answerToLife, tacoThoughts) {
12          var text = [
13            'the answer to life is ' + answerToLife
14          , 'thoughts on tacos? ' + tacoThoughts
15          ].join('\n');
16
17          return 'echo "' + text + '" > test3';
18        }
19      }
20    , test4: {
21        cmd: function(){
22          return 'echo "you can use callback, and error, stdout, stderr can be used as arguments"';
23        }
24      , callback: function(error, stdout, stderr){
25          var fs = require('fs')
26            , path = require('path')
27            , outputPath = path.resolve(process.cwd(), 'test4');
28
29          console.log('outputPath : ' + outputPath);
30          fs.writeFileSync(outputPath, stdout, 'utf-8');
31        }
32      }
33    , test5: {
34        cmd: 'exit 8'
35      , exitCodes: 8
36      }
37    , test6: {
38        cmd: 'exit 9'
39      , exitCodes: [8, 9]
40      }
41    , test7: 'echo "you don\'t even need an object" > test7'
42    }
43  });
44
45  grunt.loadTasks('../tasks');
46};
Note: See TracBrowser for help on using the repository browser.