Merge pull request #6397 from murgatroid99/node_tools_minor_fix

Node tools: use the right extension for running protoc on Windows
pull/6415/head
Nicolas Noble 9 years ago
commit a0d1529f6b
  1. 4
      src/node/tools/bin/protoc.js
  2. 6
      src/node/tools/bin/protoc_plugin.js

@ -43,7 +43,9 @@
var path = require('path'); var path = require('path');
var execFile = require('child_process').execFile; 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) { execFile(protoc, process.argv.slice(2), function(error, stdout, stderr) {
if (error) { if (error) {

@ -43,9 +43,11 @@
var path = require('path'); var path = require('path');
var execFile = require('child_process').execFile; 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) { if (error) {
throw error; throw error;
} }

Loading…
Cancel
Save