Fix #23. use build_dir
as specified in config.rb
This commit is contained in:
parent
73fad02a78
commit
41f33b69d2
1 changed files with 8 additions and 4 deletions
|
@ -73,11 +73,15 @@ end
|
||||||
EOF
|
EOF
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def inst
|
||||||
|
::Middleman::Application.server.inst
|
||||||
|
end
|
||||||
|
|
||||||
def deploy_options
|
def deploy_options
|
||||||
options = nil
|
options = nil
|
||||||
|
|
||||||
begin
|
begin
|
||||||
options = ::Middleman::Application.server.inst.options
|
options = inst.options
|
||||||
rescue
|
rescue
|
||||||
print_usage_and_die "You need to activate the deploy extension in config.rb."
|
print_usage_and_die "You need to activate the deploy extension in config.rb."
|
||||||
end
|
end
|
||||||
|
@ -109,7 +113,7 @@ EOF
|
||||||
|
|
||||||
puts "## Deploying via rsync to #{user}@#{host}:#{path} port=#{port}"
|
puts "## Deploying via rsync to #{user}@#{host}:#{path} port=#{port}"
|
||||||
|
|
||||||
command = "rsync -avze '" + "ssh -p #{port}" + "' build/ #{user}@#{host}:#{path}"
|
command = "rsync -avze '" + "ssh -p #{port}" + "' #{self.inst.build_dir}/ #{user}@#{host}:#{path}"
|
||||||
|
|
||||||
if options.has_key? "clean"
|
if options.has_key? "clean"
|
||||||
clean = options.clean
|
clean = options.clean
|
||||||
|
@ -141,7 +145,7 @@ EOF
|
||||||
exit
|
exit
|
||||||
end
|
end
|
||||||
|
|
||||||
Dir.chdir('build') do
|
Dir.chdir(self.inst.build_dir) do
|
||||||
unless File.exists?('.git')
|
unless File.exists?('.git')
|
||||||
`git init`
|
`git init`
|
||||||
`git remote add origin #{remote}`
|
`git remote add origin #{remote}`
|
||||||
|
@ -182,7 +186,7 @@ EOF
|
||||||
ftp.chdir(path)
|
ftp.chdir(path)
|
||||||
ftp.passive = true
|
ftp.passive = true
|
||||||
|
|
||||||
Dir.chdir('build/') do
|
Dir.chdir(self.inst.build_dir) do
|
||||||
files = Dir.glob('**/*', File::FNM_DOTMATCH)
|
files = Dir.glob('**/*', File::FNM_DOTMATCH)
|
||||||
files.reject { |a| a =~ Regexp.new('\.$') }.each do |f|
|
files.reject { |a| a =~ Regexp.new('\.$') }.each do |f|
|
||||||
if File.directory?(f)
|
if File.directory?(f)
|
||||||
|
|
Loading…
Reference in a new issue