Execute binaries from root node modules (#4302)
This commit is contained in:
parent
4eddf51eb9
commit
51be418b3d
|
|
@ -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');
|
||||
|
|
@ -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) {
|
||||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue