sendak
Version:
Sendak manages metadata for cloud deployments
42 lines (34 loc) • 1.19 kB
JavaScript
;
var rm = require( 'rm' )
, metadata = rm.new_object( 'github-project' );
var meta = function () {
return {
'args' : {
'github-project-name' : [ String, 'What is the name of this github project' ],
'base-url' : [ String, 'The url to be used for a `git clone` operation' ]
},
'name' : 'create-github-project',
'abstract' : 'creates a new record for a project on github in the Sendak rm'
}
}
var plug = function (args) {
var Sendak = require( '../../lib/js/sendak.js' )
, rm = Sendak.rm
, logger = Sendak.getlogger()
, stdout = Sendak.stdout
if (args['github-project-name'] && args['base-url']) {
metadata['github-project-name'] = args['github-project-name'];
metadata['base-url'] = args['base-url'];
logger.debug( 'Adding new object to github-project', metadata );
rm.add_object( 'github-project', metadata )
stdout( JSON.stringify(metadata) );
process.exit(0); // success
}
else {
stdout( 'both github-project-name and base-url must be supplied at invocation thx' );
process.exit(-255); // nope
}
}
module.exports = plug;
plug.meta = meta;
// jane@cpan.org // vim:tw=80:ts=2:noet