From 2d488c9bfc3e7efc6e04803dfe36d39dc42dfddd Mon Sep 17 00:00:00 2001 From: Stanley Liu Date: Tue, 11 Aug 2020 17:25:18 +0100 Subject: [PATCH] moved a couple of guider comments around --- lib/modules/sync_seeds.rb | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/modules/sync_seeds.rb b/lib/modules/sync_seeds.rb index ec7e87188..22ec5fd0f 100644 --- a/lib/modules/sync_seeds.rb +++ b/lib/modules/sync_seeds.rb @@ -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) @@ -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, @@ -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