Skip to content

Commit

Permalink
Merge 6b57479 into 0f8aa79
Browse files Browse the repository at this point in the history
  • Loading branch information
dyladan authored Nov 16, 2023
2 parents 0f8aa79 + 6b57479 commit 5b172e1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions scripts/generate-protos.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ const cp = require('child_process');
const path = require('path');

const appRoot = process.cwd();
const rootBinDir = path.resolve(__dirname, '..', 'node_modules', '.bin');

const generatedPath = path.resolve(appRoot, './src/generated');
const protosPath = path.resolve(appRoot, './protos');
Expand Down Expand Up @@ -40,7 +41,7 @@ function pbts(pbjsOutFile) {
const pbtsOptions = [
'-o', path.join(generatedPath, 'root.d.ts'),
];
return exec('npx', ['--package=protobufjs-cli', 'pbts', ...pbtsOptions, pbjsOutFile]);
return exec(path.resolve(rootBinDir, 'pbts'), [...pbtsOptions, pbjsOutFile]);
}

async function pbjs(files) {
Expand All @@ -52,7 +53,7 @@ async function pbjs(files) {
'--null-defaults',
'-o', outFile,
];
await exec('npx', ['--package=protobufjs-cli', 'pbjs', ...pbjsOptions, ...files]);
await exec(path.resolve(rootBinDir, 'pbjs'), [...pbjsOptions, ...files]);
return outFile;
}

Expand Down

0 comments on commit 5b172e1

Please sign in to comment.