Created
October 26, 2012 08:51
-
-
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)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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