lib/rim/module_helper.rb
def prepare_empty_folder(local_path, ignores)
    ignores = FileHelper.find_matching_files(local_path, true, ignores)
    FileHelper.find_matching_files(local_path, true, "/**/*", File::FNM_DOTMATCH).each do |f|
      if File.file?(f) && !ignores.include?(f)
        FileUtils.rm(f)
      end
    end
    FileHelper.remove_empty_dirs(local_path)
    FileUtils.mkdir_p(local_path)
  end
def prepare_empty_folder(local_path, ignores)
    ignores = FileHelper.find_matching_files(local_path, true, ignores)
    FileHelper.find_matching_files(local_path, true, "/**/*", File::FNM_DOTMATCH).each do |f|
      if File.file?(f) && !ignores.include?(f)
        FileUtils.rm(f)
      end
    end
    FileHelper.remove_empty_dirs(local_path)
    FileUtils.mkdir_p(local_path)
  end
prepare empty folder: remove all files not on the ignore list and empty folders