Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Jason Hutchens committed Nov 9, 2011
1 parent bdfaf15 commit e26f5ca
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lib/asset_sync/storage.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ def delete_file(f, remote_files_to_delete)
def delete_extra_remote_files
STDERR.puts "Fetching files to flag for delete"
remote_files = get_remote_files
from_remote_files_to_delete = (local_files | remote_files) - (local_files & remote_files)
# fixes: https://github.com/rumblelabs/asset_sync/issues/19
from_remote_files_to_delete = remote_files - local_files

STDERR.puts "Flagging #{from_remote_files_to_delete.size} file(s) for deletion"
# Delete unneeded remote files
Expand Down Expand Up @@ -115,7 +116,8 @@ def upload_file(f)
def upload_files
# get a fresh list of remote files
remote_files = get_remote_files
local_files_to_upload = (remote_files | local_files) - (remote_files & local_files)
# fixes: https://github.com/rumblelabs/asset_sync/issues/19
local_files_to_upload = local_files - remote_files

# Upload new files
local_files_to_upload.each do |f|
Expand All @@ -125,8 +127,9 @@ def upload_files
end

def sync
delete_extra_remote_files unless keep_existing_remote_files?
# fixes: https://github.com/rumblelabs/asset_sync/issues/19
upload_files
delete_extra_remote_files unless keep_existing_remote_files?
STDERR.puts "Done."
end

Expand Down

0 comments on commit e26f5ca

Please sign in to comment.