Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Small rttlua script that bootstraps a property file given a component (only for properties which are natively part of the component)
#!/usr/bin/env rttlua
if #arg~=3 or arg[1]=="--help" or arg[1] == "-h" then
print [[Usage:
bootstrap-cpf.lua package type output.cpf
with:
package: the package to import which contains the component
type: the type of the component
output.cpf: name of the property file
]]
return
end
require 'rttlib'
dp=rtt.getTC():getPeer('deployer')
if not dp:import(arg[1]) then
return
end
if not dp:loadComponent("comp",arg[2]) then
return
end
comp = dp:getPeer("comp")
comp:loadService("marshalling")
comp:provides("marshalling"):writeProperties(arg[3])
return
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.