Ignore:
Timestamp:
03/14/14 12:36:58 (11 years ago)
Author:
hendrikvanantwerpen
Message:

Enable deployment with Grunt.

Location:
Dev/trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • Dev/trunk

    • Property svn:ignore
      •  

        old new  
        11build
        2 quod-erat.git
  • Dev/trunk/node_modules/grunt-exec/.travis.yml

    r484 r516  
    11language: node_js
    22node_js:
    3   - 0.8
     3  - "0.8"
     4  - "0.10"
  • Dev/trunk/node_modules/grunt-exec/Gruntfile.js

    r484 r516  
    1010        cmd: 'ls -l **'
    1111      }
     12    , list_all_files: 'ls -la'
    1213    , echo_grunt_version: {
    1314        cmd: function() { return 'echo ' + this.version; }
  • Dev/trunk/node_modules/grunt-exec/README.md

    r484 r516  
    2323-----
    2424
    25 This plugin is a [multi task][types_of_tasks], meaning that grunt will automatically iterate over all exec targets if a target is not specified.
     25This plugin is a [multi task][types_of_tasks], meaning that grunt will
     26automatically iterate over all exec targets if a target is not specified.
    2627
    27 If the exit code generated by the specified shell command is greater than 0, grunt-exec will assume an error has occurred and will abort grunt immediately.
     28If the exit code generated by the specified shell command is greater than 0,
     29grunt-exec will assume an error has occurred and will abort grunt immediately.
    2830
    29 [types_of_tasks]: https://github.com/gruntjs/grunt/blob/master/docs/types_of_tasks.md#multi-tasks
     31[types_of_tasks]: http://gruntjs.com/configuring-tasks#task-configuration-and-targets
    3032
    3133### Properties
    3234
    33 *   __command__: The shell command to be executed. Must be a string or a function that returns a string. (alias: __cmd__)
    34 *   __stdout__: If `true`, stdout will be printed. Defaults to `true`.
    35 *   __stderr__: If `true`, stderr will be printed. Defaults to `true`.
    36 *   __cwd__: Current working directory of the shell command. Defaults to the directory containing your Gruntfile.
    37 *   __exitCode__: The expected exit code, task will fail if the actual exit code doesn't match. Defaults to `0`.
    38 *   __callback__: The callback function passed `child_process.exec`. Defaults to a noop.
     35*  __command__ (alias: __cmd__): The shell command to be executed. Must be a
     36  string or a function that returns a string.
     37*  __stdout__: If `true`, stdout will be printed. Defaults to `true`.
     38*  __stderr__: If `true`, stderr will be printed. Defaults to `true`.
     39*  __cwd__: Current working directory of the shell command. Defaults to the
     40  directory containing your Gruntfile.
     41*  __exitCode__ (alias: __exitCodes__): The expected exit code(s), task will
     42  fail if the actual exit code doesn't match. Defaults to `0`. Can be an array
     43  for multiple allowed exit codes.
     44*  __callback__: The callback function passed `child_process.exec`. Defaults to
     45  a noop.
     46
     47If the configuration is instead a simple `string`, it will be
     48interpreted as a full command itself:
     49
     50```javascript
     51exec: {
     52  echo_something: 'echo "This is something"'
     53}
     54```
    3955
    4056### Command Functions
    4157
    42 If you plan on doing advanced stuff with grunt-exec, you'll most likely be using functions for the `command` property of your exec targets. This section details a couple of helpful tips about command functions that could help make your life easier.
     58If you plan on doing advanced stuff with grunt-exec, you'll most likely be using
     59functions for the `command` property of your exec targets. This section details
     60a couple of helpful tips about command functions that could help make your life
     61easier.
    4362
    4463#### Passing arguments from the command line
    4564
    46 Command functions can be called with arbitrary arguments. Let's say we have the following exec target that echoes a formatted name:
     65Command functions can be called with arbitrary arguments. Let's say we have the
     66following exec target that echoes a formatted name:
    4767
    4868```javascript
     
    6181```
    6282
    63 In order to get `SIMPSON, HOMER` echoed, you'd run `grunt exec:echo_name:homer:simpson` from the command line.
     83In order to get `SIMPSON, HOMER` echoed, you'd run
     84`grunt exec:echo_name:homer:simpson` from the command line.
    6485
    6586### Accessing `grunt` object
    6687
    67 All command functions are called in the context of the `grunt` object that they are being ran with. This means you can access the `grunt` object through `this`.
     88All command functions are called in the context of the `grunt` object that they
     89are being ran with. This means you can access the `grunt` object through `this`.
    6890
    6991### Example
     
    82104      cmd: 'ls -l **'
    83105    },
     106    list_all_files: 'ls -la',
    84107    echo_grunt_version: {
    85108      cmd: function() { return 'echo ' + this.version; }
     
    117140----------
    118141
    119 For transparency and insight into the release cycle, releases will be numbered with the follow format:
     142For transparency and insight into the release cycle, releases will be numbered
     143with the follow format:
    120144
    121145`<major>.<minor>.<patch>`
  • Dev/trunk/node_modules/grunt-exec/package.json

    r484 r516  
    22  "name": "grunt-exec",
    33  "description": "Grunt task for executing shell commands.",
    4   "version": "0.4.2",
     4  "version": "0.4.5",
    55  "homepage": "https://github.com/jharding/grunt-exec",
    66  "author": {
     
    4040    "shell"
    4141  ],
    42   "readme": "[![build status](https://secure.travis-ci.org/jharding/grunt-exec.png?branch=master)](http://travis-ci.org/jharding/grunt-exec)\ngrunt-exec\n==========\n\nGrunt plugin for executing shell commands.\n\nInstallation\n------------\n\nInstall grunt-exec using npm:\n\n```\n$ npm install grunt-exec\n```\n\nThen add this line to your project's *Gruntfile.js*:\n\n```javascript\ngrunt.loadNpmTasks('grunt-exec');\n```\n\nUsage\n-----\n\nThis plugin is a [multi task][types_of_tasks], meaning that grunt will automatically iterate over all exec targets if a target is not specified.\n\nIf the exit code generated by the specified shell command is greater than 0, grunt-exec will assume an error has occurred and will abort grunt immediately.\n\n[types_of_tasks]: https://github.com/gruntjs/grunt/blob/master/docs/types_of_tasks.md#multi-tasks\n\n### Properties\n\n*   __command__: The shell command to be executed. Must be a string or a function that returns a string. (alias: __cmd__)\n*   __stdout__: If `true`, stdout will be printed. Defaults to `true`.\n*   __stderr__: If `true`, stderr will be printed. Defaults to `true`.\n*   __cwd__: Current working directory of the shell command. Defaults to the directory containing your Gruntfile.\n*   __exitCode__: The expected exit code, task will fail if the actual exit code doesn't match. Defaults to `0`.\n*   __callback__: The callback function passed `child_process.exec`. Defaults to a noop.\n\n### Command Functions\n\nIf you plan on doing advanced stuff with grunt-exec, you'll most likely be using functions for the `command` property of your exec targets. This section details a couple of helpful tips about command functions that could help make your life easier.\n\n#### Passing arguments from the command line\n\nCommand functions can be called with arbitrary arguments. Let's say we have the following exec target that echoes a formatted name:\n\n```javascript\nexec: {\n  echo_name: {\n    cmd: function(firstName, lastName) {\n      var formattedName = [\n        lastName.toUpperCase(),\n        firstName.toUpperCase()\n      ].join(', ');\n\n      return 'echo ' + formattedName;\n    }\n  }\n}\n```\n\nIn order to get `SIMPSON, HOMER` echoed, you'd run `grunt exec:echo_name:homer:simpson` from the command line.\n\n### Accessing `grunt` object\n\nAll command functions are called in the context of the `grunt` object that they are being ran with. This means you can access the `grunt` object through `this`.\n\n### Example\n\nThe following examples are available in grunt-exec's Gruntfile.\n\n```javascript\ngrunt.initConfig({\n  exec: {\n    remove_logs: {\n      command: 'rm -f *.log',\n      stdout: false,\n      stderr: false\n    },\n    list_files: {\n      cmd: 'ls -l **'\n    },\n    echo_grunt_version: {\n      cmd: function() { return 'echo ' + this.version; }\n    },\n    echo_name: {\n      cmd: function(firstName, lastName) {\n        var formattedName = [\n          lastName.toUpperCase(),\n          firstName.toUpperCase()\n        ].join(', ');\n\n        return 'echo ' + formattedName;\n      }\n    }\n  }\n});\n```\n\nTesting\n-------\n\n```\n$ cd grunt-exec\n$ npm test\n```\n\nIssues\n------\n\nFound a bug? Create an issue on GitHub.\n\nhttps://github.com/jharding/grunt-exec/issues\n\nVersioning\n----------\n\nFor transparency and insight into the release cycle, releases will be numbered with the follow format:\n\n`<major>.<minor>.<patch>`\n\nAnd constructed with the following guidelines:\n\n* Breaking backwards compatibility bumps the major\n* New additions without breaking backwards compatibility bumps the minor\n* Bug fixes and misc changes bump the patch\n\nFor more information on semantic versioning, please visit http://semver.org/.\n\nLicense\n-------\n\nCopyright (c) 2012 [Jake Harding](http://thejakeharding.com)  \nLicensed under the MIT License.\n",
     42  "readme": "[![build status](https://secure.travis-ci.org/jharding/grunt-exec.png?branch=master)](http://travis-ci.org/jharding/grunt-exec)\ngrunt-exec\n==========\n\nGrunt plugin for executing shell commands.\n\nInstallation\n------------\n\nInstall grunt-exec using npm:\n\n```\n$ npm install grunt-exec\n```\n\nThen add this line to your project's *Gruntfile.js*:\n\n```javascript\ngrunt.loadNpmTasks('grunt-exec');\n```\n\nUsage\n-----\n\nThis plugin is a [multi task][types_of_tasks], meaning that grunt will \nautomatically iterate over all exec targets if a target is not specified.\n\nIf the exit code generated by the specified shell command is greater than 0, \ngrunt-exec will assume an error has occurred and will abort grunt immediately.\n\n[types_of_tasks]: http://gruntjs.com/configuring-tasks#task-configuration-and-targets\n\n### Properties\n\n*  __command__ (alias: __cmd__): The shell command to be executed. Must be a \n  string or a function that returns a string.\n*  __stdout__: If `true`, stdout will be printed. Defaults to `true`.\n*  __stderr__: If `true`, stderr will be printed. Defaults to `true`.\n*  __cwd__: Current working directory of the shell command. Defaults to the \n  directory containing your Gruntfile.\n*  __exitCode__ (alias: __exitCodes__): The expected exit code(s), task will \n  fail if the actual exit code doesn't match. Defaults to `0`. Can be an array \n  for multiple allowed exit codes.\n*  __callback__: The callback function passed `child_process.exec`. Defaults to \n  a noop.\n\nIf the configuration is instead a simple `string`, it will be\ninterpreted as a full command itself:\n\n```javascript\nexec: {\n  echo_something: 'echo \"This is something\"'\n}\n```\n\n### Command Functions\n\nIf you plan on doing advanced stuff with grunt-exec, you'll most likely be using \nfunctions for the `command` property of your exec targets. This section details \na couple of helpful tips about command functions that could help make your life \neasier.\n\n#### Passing arguments from the command line\n\nCommand functions can be called with arbitrary arguments. Let's say we have the \nfollowing exec target that echoes a formatted name:\n\n```javascript\nexec: {\n  echo_name: {\n    cmd: function(firstName, lastName) {\n      var formattedName = [\n        lastName.toUpperCase(),\n        firstName.toUpperCase()\n      ].join(', ');\n\n      return 'echo ' + formattedName;\n    }\n  }\n}\n```\n\nIn order to get `SIMPSON, HOMER` echoed, you'd run \n`grunt exec:echo_name:homer:simpson` from the command line.\n\n### Accessing `grunt` object\n\nAll command functions are called in the context of the `grunt` object that they \nare being ran with. This means you can access the `grunt` object through `this`.\n\n### Example\n\nThe following examples are available in grunt-exec's Gruntfile.\n\n```javascript\ngrunt.initConfig({\n  exec: {\n    remove_logs: {\n      command: 'rm -f *.log',\n      stdout: false,\n      stderr: false\n    },\n    list_files: {\n      cmd: 'ls -l **'\n    },\n    list_all_files: 'ls -la',\n    echo_grunt_version: {\n      cmd: function() { return 'echo ' + this.version; }\n    },\n    echo_name: {\n      cmd: function(firstName, lastName) {\n        var formattedName = [\n          lastName.toUpperCase(),\n          firstName.toUpperCase()\n        ].join(', ');\n\n        return 'echo ' + formattedName;\n      }\n    }\n  }\n});\n```\n\nTesting\n-------\n\n```\n$ cd grunt-exec\n$ npm test\n```\n\nIssues\n------\n\nFound a bug? Create an issue on GitHub.\n\nhttps://github.com/jharding/grunt-exec/issues\n\nVersioning\n----------\n\nFor transparency and insight into the release cycle, releases will be numbered \nwith the follow format:\n\n`<major>.<minor>.<patch>`\n\nAnd constructed with the following guidelines:\n\n* Breaking backwards compatibility bumps the major\n* New additions without breaking backwards compatibility bumps the minor\n* Bug fixes and misc changes bump the patch\n\nFor more information on semantic versioning, please visit http://semver.org/.\n\nLicense\n-------\n\nCopyright (c) 2012 [Jake Harding](http://thejakeharding.com)  \nLicensed under the MIT License.\n",
    4343  "readmeFilename": "README.md",
    44   "_id": "grunt-exec@0.4.2",
     44  "_id": "grunt-exec@0.4.5",
    4545  "dist": {
    46     "shasum": "021f0dddaeef00cc4d83dff9d0d8c47a64917dbd"
     46    "shasum": "2848b5f9ed0a096b459a637aad35cc89098b7958"
    4747  },
    48   "_from": "grunt-exec@0.4.2",
    49   "_resolved": "https://registry.npmjs.org/grunt-exec/-/grunt-exec-0.4.2.tgz"
     48  "_from": "grunt-exec@0.4.5",
     49  "_resolved": "https://registry.npmjs.org/grunt-exec/-/grunt-exec-0.4.5.tgz"
    5050}
  • Dev/trunk/node_modules/grunt-exec/tasks/exec.js

    r484 r516  
    1818      , stderr = data.stderr !== undefined ? data.stderr : true
    1919      , callback = _.isFunction(data.callback) ? data.callback : function() {}
    20       , exitCode = data.exitCode || 0
     20      , exitCodes = data.exitCode || data.exitCodes || 0
    2121      , command
    2222      , childProcess
     
    2424      , done = this.async();
    2525
     26    // https://github.com/jharding/grunt-exec/pull/30
     27    exitCodes = _.isArray(exitCodes) ? exitCodes : [exitCodes];
     28
    2629    // allow for command to be specified in either
    27     // 'command' or 'cmd' property
    28     command = data.command || data.cmd;
     30    // 'command' or 'cmd' property, or as a string.
     31    command = data.command || data.cmd || (_.isString(data) && data);
    2932
    3033    data.cwd && (execOptions.cwd = data.cwd);
     
    4649
    4750    verbose.subhead(command);
    48     verbose.writeln(f('Expecting exit code %d', exitCode));
     51    verbose.writeln(f('Expecting exit code %s', exitCodes.join(' or ')));
    4952
    5053    childProcess = cp.exec(command, execOptions, callback);
     
    5457
    5558    childProcess.on('exit', function(code) {
    56       if (code !== exitCode) {
     59      if (exitCodes.indexOf(code) < 0) {
    5760        log.error(f('Exited with code: %d.', code));
    5861        return done(false);
  • Dev/trunk/node_modules/grunt-exec/test/Gruntfile.js

    r484 r516  
    2121        cmd: function(){
    2222          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           var path = require('path');
    27           var outputPath = path.resolve(process.cwd(), 'test4');
     23        }
     24      , callback: function(error, stdout, stderr){
     25          var fs = require('fs')
     26            , path = require('path')
     27            , outputPath = path.resolve(process.cwd(), 'test4');
     28
    2829          console.log('outputPath : ' + outputPath);
    2930          fs.writeFileSync(outputPath, stdout, 'utf-8');
    3031        }
    3132      }
     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'
    3242    }
    3343  });
  • Dev/trunk/node_modules/grunt-exec/test/test.js

    r484 r516  
    55  , testDir = path.join(process.cwd(), 'test')
    66  , opts = { gruntfile: path.join(testDir, 'Gruntfile.js') }
    7   , tasks = ['exec:test1', 'exec:test2', 'exec:test3:42:love', 'exec:test4'];
     7  , tasks = [
     8      'exec:test1'
     9    , 'exec:test2'
     10    , 'exec:test3:42:love'
     11    , 'exec:test4'
     12    , 'exec:test5'
     13    , 'exec:test6'
     14    , 'exec:test7'
     15    ];
    816
    917grunt.tasks(tasks, opts, function() {
     
    2129        , expected:'you can use callback, and error, stdout, stderr can be used as arguments\n'
    2230        }
     31      , { name: 'test7', expected: 'you don\'t even need an object\n' }
    2332      ]
    2433    , outputPath;
Note: See TracChangeset for help on using the changeset viewer.