Node tools: use the right extension for running protoc on Windows

This commit is contained in:
murgatroid99 2016-05-02 13:57:57 -07:00
parent 92432a67e4
commit 6eb07870fd
2 changed files with 7 additions and 3 deletions

View File

@ -43,7 +43,9 @@
var path = require('path');
var execFile = require('child_process').execFile;
var protoc = path.resolve(__dirname, 'protoc');
var exe_ext = process.platform === 'win32' ? '.exe' : '';
var protoc = path.resolve(__dirname, 'protoc' + exe_ext);
execFile(protoc, process.argv.slice(2), function(error, stdout, stderr) {
if (error) {

View File

@ -43,9 +43,11 @@
var path = require('path');
var execFile = require('child_process').execFile;
var protoc = path.resolve(__dirname, 'grpc_node_plugin');
var exe_ext = process.platform === 'win32' ? '.exe' : '';
execFile(protoc, process.argv.slice(2), function(error, stdout, stderr) {
var plugin = path.resolve(__dirname, 'grpc_node_plugin' + exe_ext);
execFile(plugin, process.argv.slice(2), function(error, stdout, stderr) {
if (error) {
throw error;
}