lib/roku_builder/plugins/loader.rb in roku_builder-4.21.3 vs lib/roku_builder/plugins/loader.rb in roku_builder-4.21.4
- old
+ new
@@ -5,11 +5,11 @@
# Load/Unload/Build roku applications
class Loader < Util
extend Plugin
def init
- @warningFileSize = 250 * 1024
+ @warningFileSize = 500 * 1024
end
def self.commands
{
sideload: {source: true, device: true, stage: true},
@@ -35,10 +35,13 @@
end
parser.separator "Options:"
parser.on("-x", "--exclude", "Apply exclude config to sideload") do
options[:exclude] = true
end
+ parser.on("--remote-debug", "Sideload will enable remote debug") do
+ options[:remoteDebug] = true
+ end
end
def self.dependencies
[Navigator]
end
@@ -50,11 +53,11 @@
unless options[:in]
did_build = true
build(options: options)
end
keep_build_file = is_build_command(options) and options[:out]
- upload
+ upload(options)
# Cleanup
File.delete(file_path(:in)) if did_build and not keep_build_file
end
@@ -97,14 +100,15 @@
def is_build_command(options)
[:sideload, :build].include? options.command
end
- def upload
+ def upload(options)
payload = {
mysubmit: "Replace",
- archive: Faraday::UploadIO.new(file_path(:in), 'application/zip')
+ archive: Faraday::UploadIO.new(file_path(:in), 'application/zip'),
}
+ payload["remotedebug"] = "1" if options[:remoteDebug]
response = multipart_connection.post "/plugin_install", payload
@logger.debug("Status: #{response.status}, Body: #{response.body}")
if response.status==200 and response.body=~/Identical to previous version/
@logger.warn("Sideload identival to previous version")
elsif not (response.status==200 and response.body=~/Install Success/)