From 8cb0500c0d5c3398795a366341f20fa8122cc230 Mon Sep 17 00:00:00 2001 From: Tom Vaughan Date: Tue, 16 Jul 2013 21:53:11 -0400 Subject: [PATCH] remove the --clean command-line option --- README.md | 16 +++++++++++----- lib/middleman-deploy/commands.rb | 13 ++----------- 2 files changed, 13 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 9d5762c..333766c 100644 --- a/README.md +++ b/README.md @@ -120,7 +120,7 @@ Adjust these values accordingly. ## Step 4 middleman build [--clean] - middleman deploy [--clean --build-before] + middleman deploy [--build-before] To run `middleman build` before `middleman deploy`, add: @@ -128,11 +128,17 @@ To run `middleman build` before `middleman deploy`, add: Default is `false`. -## NOTES +## BREAKING CHANGES -When the `--clean` or `--no-clean` option is passed to `middleman -build` it will not be passed to `middleman deploy`. For now only the -value of `deploy.clean` in `config.rb` will be used. + * v0.1.0 + + * Removed the `--clean` command-line option. This option only applied + to the rsync deploy method. The idea going forward is that + command-line options must apply to all deploy methods. Options that + are specific to a deploy method will only be available in + `config.rb`. + +## NOTES Inspired by the rsync task in [Octopress](https://github.com/imathis/octopress). diff --git a/lib/middleman-deploy/commands.rb b/lib/middleman-deploy/commands.rb index 8cd2cbd..f65616e 100644 --- a/lib/middleman-deploy/commands.rb +++ b/lib/middleman-deploy/commands.rb @@ -23,14 +23,11 @@ module Middleman end desc "deploy [options]", Middleman::Deploy::TAGLINE - method_option "clean", - :type => :boolean, - :aliases => "-c", - :desc => "Remove orphaned files or directories on the remote host" method_option "build_before", :type => :boolean, :aliases => "-b", :desc => "Run `middleman build` before the deploy step" + def deploy if options.has_key? "build_before" build_before = options.build_before @@ -129,13 +126,7 @@ EOF command = "rsync -avze '" + "ssh -p #{port}" + "' #{self.inst.build_dir}/ #{user}@#{host}:#{path}" - if options.has_key? "clean" - clean = options.clean - else - clean = self.deploy_options.clean - end - - if clean + if self.deploy_options.clean command += " --delete" end