Skip to content

Commit

Permalink
Merge pull request #21 from btobolaski/grunt-options
Browse files Browse the repository at this point in the history
Added the ability to specify the target in the gruntfile.
  • Loading branch information
getdave committed Nov 12, 2013
2 parents 8c7f92d + 0f375c2 commit 705c68a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,12 @@ A string value that represents the directory path (*relative* to your Grunt file

You may wish to have your backups reside outside the current working directory of your Gruntfile. In which case simply provide the relative path eg: ````../../backups````.

#### options.target

Type: `String`
Default value: ``

A string value that represents the default target for the tasks. You can easily override it using the `--target` option

## Contributing

Expand Down
4 changes: 2 additions & 2 deletions tasks/deployments.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ module.exports = function(grunt) {
var task_options = grunt.config.get('deployments')['options'];

// Get the target from the CLI args
var target = grunt.option('target');
var target = grunt.option('target') || task_options['target'];

if ( typeof target === "undefined" || typeof grunt.config.get('deployments')[target] === "undefined") {
grunt.fail.warn("Invalid target specified. Did you pass the wrong argument? Please check your task configuration.", 6);
Expand Down Expand Up @@ -69,7 +69,7 @@ module.exports = function(grunt) {
var task_options = grunt.config.get('deployments')['options'];

// Get the target from the CLI args
var target = grunt.option('target');
var target = grunt.option('target') || task_options['target'];

if ( typeof target === "undefined" || typeof grunt.config.get('deployments')[target] === "undefined") {
grunt.fail.warn("Invalid target provided. I cannot pull a database from nowhere! Please checked your configuration and provide a valid target.", 6);
Expand Down

0 comments on commit 705c68a

Please sign in to comment.