diff options
author | 2016-05-02 15:57:37 -0700 | |
---|---|---|
committer | 2016-05-02 15:57:37 -0700 | |
commit | a0d1529f6b58cab58917faf9488e6342729a70cb (patch) | |
tree | 14b9a7706395b8aff5b54c6261661a934922693c /src/node | |
parent | b3d55334b19ce08ba56db82f543c8a8a0684d56b (diff) | |
parent | 8a6efb7a42bc305d96163ef7c16167bf004cf1ab (diff) |
Merge pull request #6397 from murgatroid99/node_tools_minor_fix
Node tools: use the right extension for running protoc on Windows
Diffstat (limited to 'src/node')
-rwxr-xr-x | src/node/tools/bin/protoc.js | 4 | ||||
-rwxr-xr-x | src/node/tools/bin/protoc_plugin.js | 6 |
2 files changed, 7 insertions, 3 deletions
diff --git a/src/node/tools/bin/protoc.js b/src/node/tools/bin/protoc.js index 0c6d7ce017..4d50c94b0f 100755 --- a/src/node/tools/bin/protoc.js +++ b/src/node/tools/bin/protoc.js @@ -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) { diff --git a/src/node/tools/bin/protoc_plugin.js b/src/node/tools/bin/protoc_plugin.js index 0e0bb9406e..281ec0d85e 100755 --- a/src/node/tools/bin/protoc_plugin.js +++ b/src/node/tools/bin/protoc_plugin.js @@ -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; } |