service_packager now properly generates service and package files

This commit is contained in:
murgatroid99 2015-05-12 12:39:22 -07:00
parent 1ca5f1e54f
commit 27eed6c644
3 changed files with 8 additions and 3 deletions

View File

@ -78,7 +78,9 @@ function copyFile(src_path, dest_path) {
function main(argv) {
var args = parseArgs(argv, arg_format);
var out_path = path.resolve(args.out);
var include_dirs = _.map(path.resolve, args.include);
var include_dirs = _.map(_.flatten([args.include]), function(p) {
return path.resolve(p);
});
args.grpc_version = package_json.version;
generatePackage(args, function(err, rendered) {
if (err) throw err;
@ -97,6 +99,7 @@ function main(argv) {
'service.json'));
var pbjs_args = _.flatten(['node', 'pbjs',
args._[0],
'-legacy',
_.map(include_dirs, function(dir) {
return "-path=" + dir;
})]);

View File

@ -32,4 +32,5 @@
*/
var grpc = require('grpc');
module.exports = grpc.load(__dirname + '/service.json');
exports.client = grpc.load(__dirname + '/service.json', 'json');
exports.auth = require('google-auth-library');

View File

@ -5,7 +5,8 @@
"description": "Client library for {{{name}}} built on gRPC",
"license": "Apache-2.0",
"dependencies": {
"grpc": "{{{grpc_version}}}"
"grpc": "{{{grpc_version}}}",
"google-auth-library": "^0.9.2"
},
"main": "index.js",
"files": [