Skip to content

Instantly share code, notes, and snippets.

@smits
Created October 26, 2012 08:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save smits/3957702 to your computer and use it in GitHub Desktop.
Save smits/3957702 to your computer and use it in GitHub Desktop.
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