Supporting port config of SFTP

This commit is contained in:
WhiteTrefoil 2014-01-18 21:55:50 +08:00
parent 83c24d7443
commit 08875eebec
4 changed files with 4 additions and 1 deletions

View file

@ -15,6 +15,7 @@ module Middleman
@user = self.options.user
@pass = self.options.password
@path = self.options.path
@port = self.options.port
end
def process

View file

@ -10,7 +10,7 @@ module Middleman
puts "## Deploying via sftp to #{self.user}@#{self.host}:#{path}"
# `nil` is a valid value for user and/or pass.
Net::SFTP.start(self.host, self.user, :password => self.pass) do |sftp|
Net::SFTP.start(self.host, self.user, :password => self.pass, :port => self.port) do |sftp|
sftp.mkdir(self.path)
Dir.chdir(self.server_instance.build_dir) do