lib/roku_builder/plugins/loader.rb in roku_builder-4.7.2 vs lib/roku_builder/plugins/loader.rb in roku_builder-4.8.0
- old
+ new
@@ -68,10 +68,16 @@
unless response.status == 200 and response.body =~ /Delete Succeeded/ or ignoreFailure
raise ExecutionError, "Failed Unloading"
end
end
+ def copy(options:, path:)
+ @options = options
+ @target = path
+ copy_channel_files(setup_build_content)
+ end
+
private
def is_build_command(options)
[:sideload, :build].include? options.command
end
@@ -153,9 +159,20 @@
@logger.warn "Missing File: #{diskFilePath}"
end
end
end
}
+ end
+ def copy_channel_files(content)
+ [:files, :folders].each do |type|
+ content[type].each do |entity|
+ begin
+ FileUtils.copy_entry(File.join(@config.parsed[:root_dir], entity), File.join(@target, entity))
+ rescue Errno::ENOENT
+ @logger.warn "Missing Entry: #{entity}"
+ end
+ end
+ end
end
end
RokuBuilder.register_plugin(Loader)
end