Rev | Line | |
---|
[484] | 1 | module.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"'; |
---|
[516] | 23 | } |
---|
| 24 | , callback: function(error, stdout, stderr){ |
---|
| 25 | var fs = require('fs') |
---|
| 26 | , path = require('path') |
---|
| 27 | , outputPath = path.resolve(process.cwd(), 'test4'); |
---|
| 28 | |
---|
[484] | 29 | console.log('outputPath : ' + outputPath); |
---|
| 30 | fs.writeFileSync(outputPath, stdout, 'utf-8'); |
---|
| 31 | } |
---|
| 32 | } |
---|
[516] | 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' |
---|
[484] | 42 | } |
---|
| 43 | }); |
---|
| 44 | |
---|
| 45 | grunt.loadTasks('../tasks'); |
---|
| 46 | }; |
---|
Note: See
TracBrowser
for help on using the repository browser.