Skip to content

Commit

Permalink
fix: find protoc in path also in windows (#334)
Browse files Browse the repository at this point in the history
  • Loading branch information
tannera authored Jun 16, 2022
1 parent dd6fdce commit d346259
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/protoc/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ module.exports.findProtocInPath = function (envPath) {
const candidates = envPath.split(path.delimiter)
.filter(p => !p.endsWith(`node_modules${path.sep}.bin`)) // make sure to exlude ...
.filter(p => !p.endsWith(`.npm-global${path.sep}bin`)) // ...
.map(p => path.join(p, "protoc")) // we are looking for "protoc"
.map(p => path.join(p, os.platform() === "win32" ? "protoc.exe" : "protoc")) // we are looking for "protoc"
.map(p => p[0] === "~" ? path.join(os.homedir(), p.slice(1)) : p) // try expand "~"
;
for (let c of candidates) {
Expand Down

0 comments on commit d346259

Please sign in to comment.