Skip to content

Commit

Permalink
moved a couple of guider comments around
Browse files Browse the repository at this point in the history
  • Loading branch information
stanleypliu committed Aug 11, 2020
1 parent 5347cce commit 2d488c9
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions lib/modules/sync_seeds.rb
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ def compare_folders(wildcard:, local:, remote:, base: @local_base)
files_for_deletion(local_list, remote_list, base)
end

# When folders need to be checked recursively
def check_inside_folder(folder, local_list)
paths = create_paths(folder)

Expand All @@ -93,13 +94,10 @@ def check_inside_folder(folder, local_list)
local_folder_content = Dir.glob('**/*', base: paths[:local_path])
remote_folder_content = @session.sftp.dir.glob(paths[:remote_path], '**/*')

# We don't want to download the whole folder again if it's already been re-downloaded once


remote_folder_content.each do |file|
# Go through the various files and folders and check to see if they exist locally
local_file = file.name.force_encoding('UTF-8')

check = check_if_newer(
parent_folder: local_folder_content,
local_item: local_file,
Expand All @@ -108,7 +106,8 @@ def check_inside_folder(folder, local_list)
local_path: paths[:local_path],
base: paths[:local_path]
)


# We don't want to download the whole folder again if it's already been re-downloaded once
# Break out of loop if already downloaded
break if check == true
end
Expand Down

0 comments on commit 2d488c9

Please sign in to comment.