remove the --clean command-line option
This commit is contained in:
parent
62248cb099
commit
8cb0500c0d
2 changed files with 13 additions and 16 deletions
16
README.md
16
README.md
|
@ -120,7 +120,7 @@ Adjust these values accordingly.
|
||||||
## Step 4
|
## Step 4
|
||||||
|
|
||||||
middleman build [--clean]
|
middleman build [--clean]
|
||||||
middleman deploy [--clean --build-before]
|
middleman deploy [--build-before]
|
||||||
|
|
||||||
To run `middleman build` before `middleman deploy`, add:
|
To run `middleman build` before `middleman deploy`, add:
|
||||||
|
|
||||||
|
@ -128,11 +128,17 @@ To run `middleman build` before `middleman deploy`, add:
|
||||||
|
|
||||||
Default is `false`.
|
Default is `false`.
|
||||||
|
|
||||||
## NOTES
|
## BREAKING CHANGES
|
||||||
|
|
||||||
When the `--clean` or `--no-clean` option is passed to `middleman
|
* v0.1.0
|
||||||
build` it will not be passed to `middleman deploy`. For now only the
|
|
||||||
value of `deploy.clean` in `config.rb` will be used.
|
* 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
|
Inspired by the rsync task in
|
||||||
[Octopress](https://github.com/imathis/octopress).
|
[Octopress](https://github.com/imathis/octopress).
|
||||||
|
|
|
@ -23,14 +23,11 @@ module Middleman
|
||||||
end
|
end
|
||||||
|
|
||||||
desc "deploy [options]", Middleman::Deploy::TAGLINE
|
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",
|
method_option "build_before",
|
||||||
:type => :boolean,
|
:type => :boolean,
|
||||||
:aliases => "-b",
|
:aliases => "-b",
|
||||||
:desc => "Run `middleman build` before the deploy step"
|
:desc => "Run `middleman build` before the deploy step"
|
||||||
|
|
||||||
def deploy
|
def deploy
|
||||||
if options.has_key? "build_before"
|
if options.has_key? "build_before"
|
||||||
build_before = options.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}"
|
command = "rsync -avze '" + "ssh -p #{port}" + "' #{self.inst.build_dir}/ #{user}@#{host}:#{path}"
|
||||||
|
|
||||||
if options.has_key? "clean"
|
if self.deploy_options.clean
|
||||||
clean = options.clean
|
|
||||||
else
|
|
||||||
clean = self.deploy_options.clean
|
|
||||||
end
|
|
||||||
|
|
||||||
if clean
|
|
||||||
command += " --delete"
|
command += " --delete"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue