From 41f33b69d25578ad10a927a06f2d3c97a7a76006 Mon Sep 17 00:00:00 2001 From: Tom Vaughan Date: Sun, 5 May 2013 20:13:14 -0400 Subject: [PATCH] Fix #23. use `build_dir` as specified in config.rb --- lib/middleman-deploy/commands.rb | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/middleman-deploy/commands.rb b/lib/middleman-deploy/commands.rb index 5acf3dd..17f07b6 100644 --- a/lib/middleman-deploy/commands.rb +++ b/lib/middleman-deploy/commands.rb @@ -73,11 +73,15 @@ end EOF end + def inst + ::Middleman::Application.server.inst + end + def deploy_options options = nil begin - options = ::Middleman::Application.server.inst.options + options = inst.options rescue print_usage_and_die "You need to activate the deploy extension in config.rb." end @@ -109,7 +113,7 @@ EOF 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" clean = options.clean @@ -141,7 +145,7 @@ EOF exit end - Dir.chdir('build') do + Dir.chdir(self.inst.build_dir) do unless File.exists?('.git') `git init` `git remote add origin #{remote}` @@ -182,7 +186,7 @@ EOF ftp.chdir(path) ftp.passive = true - Dir.chdir('build/') do + Dir.chdir(self.inst.build_dir) do files = Dir.glob('**/*', File::FNM_DOTMATCH) files.reject { |a| a =~ Regexp.new('\.$') }.each do |f| if File.directory?(f)