Permalink
Browse files

Merge pull request #1 from terenced/master

こんにちは
  • Loading branch information...
2 parents 78bd155 + 54a8194 commit ffd6e13fc781f65adb0898b058d66dd573bb22c8 @ashchan committed Apr 12, 2012
Showing with 7 additions and 1 deletion.
  1. +7 −1 ftp_sync.rb
View
@@ -131,7 +131,13 @@ def upload_folder(dir, ftp)
def sync_folder(local_dir, remote_dir, ftp)
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}"

0 comments on commit ffd6e13

Please sign in to comment.