webrain / grunt-wordpress-deploy

A Grunt plugin to quickly deploy Wordpress websites.
MIT License
104 stars 37 forks source link

Recommendation for improvement: Target as task argument #28

Open ghost opened 9 years ago

ghost commented 9 years ago

Allow the target to be specified as a task argument like "pull_db:prod", in addition to allowing it as an option or command-line argument (--target=).

Doing so allows multiple step tasks like:

grunt.registerTask('createtest', ['db_pull:prod", 'db_push:staging"]);

EvanLovely commented 9 years ago

@bobdye I've gotten around this by specifying scripts to run in package.json using the npm run command. So my package.json looks something like this:

{
  "name": "aaa",
  "version": "2.0.0",
  "scripts": {
    "pullStage": "grunt pull_db --target=stage && grunt pull_files --target=stage",
    "pushStage": "grunt push_files --target=stage && grunt push_files --target=stage"
  },
  "devDependencies": {

  }
}

And then I just run this:

npm run pullStage