|
2 | 2 | // MIT-style license that can be found in the LICENSE file or at
|
3 | 3 | // https://opensource.org/licenses/MIT.
|
4 | 4 |
|
5 |
| -import {defaults as initMakeFetchHappen} from 'make-fetch-happen'; |
6 | 5 | import extractZip = require('extract-zip');
|
7 | 6 | import {promises as fs, existsSync, mkdirSync} from 'fs';
|
| 7 | +import fetch from 'node-fetch'; |
8 | 8 | import * as p from 'path';
|
9 | 9 | import * as yaml from 'yaml';
|
10 | 10 | import * as shell from 'shelljs';
|
11 | 11 | import {extract as extractTar} from 'tar';
|
12 | 12 |
|
13 | 13 | import * as pkg from '../package.json';
|
14 | 14 |
|
15 |
| -const fetch = initMakeFetchHappen(); |
16 |
| - |
17 | 15 | shell.config.fatal = true;
|
18 | 16 |
|
19 | 17 | // Directory that holds source files.
|
@@ -309,11 +307,17 @@ function fetchRepo(options: {
|
309 | 307 | // Builds the embedded proto at `repoPath` into a pbjs with TS declaration file.
|
310 | 308 | function buildEmbeddedProtocol(repoPath: string): void {
|
311 | 309 | const proto = p.join(repoPath, 'embedded_sass.proto');
|
312 |
| - console.log(`Building pbjs and TS declaration file from ${proto}.`); |
313 | 310 | const protocPath =
|
314 | 311 | process.platform === 'win32'
|
315 | 312 | ? '%CD%/node_modules/protoc/protoc/bin/protoc.exe'
|
316 | 313 | : 'node_modules/protoc/protoc/bin/protoc';
|
| 314 | + const version = shell |
| 315 | + .exec(`${protocPath} --version`, {silent: true}) |
| 316 | + .stdout.trim(); |
| 317 | + console.log( |
| 318 | + `Building pbjs and TS declaration file from ${proto} with ${version}.` |
| 319 | + ); |
| 320 | + |
317 | 321 | const pluginPath =
|
318 | 322 | process.platform === 'win32'
|
319 | 323 | ? '%CD%/node_modules/.bin/protoc-gen-ts.cmd'
|
|
0 commit comments