Skip to content

Commit

Permalink
If the remote dir doesn't exist, it is created
Browse files Browse the repository at this point in the history
  • Loading branch information
terenced committed Apr 12, 2012
1 parent 78bd155 commit 54a8194
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion ftp_sync.rb
Expand Up @@ -131,7 +131,13 @@ def upload_folder(dir, ftp)


def sync_folder(local_dir, remote_dir, ftp) def sync_folder(local_dir, remote_dir, ftp)
Dir.chdir local_dir Dir.chdir local_dir
ftp.chdir remote_dir begin
ftp.chdir remote_dir
rescue
# if the remote dir doesn't exist, we create it
ftp.mkdir remote_dir
ftp.chdir remote_dir
end


put_title "process folder: #{Dir.pwd}" put_title "process folder: #{Dir.pwd}"


Expand Down

0 comments on commit 54a8194

Please sign in to comment.