1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | var tslib_1 = require("tslib");
|
4 | var execa = require("execa");
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 | function isCmdInstalled(cmd, args) {
|
12 | if (args === void 0) { args = ['--version']; }
|
13 | return tslib_1.__awaiter(this, void 0, void 0, function () {
|
14 | var e_1;
|
15 | return tslib_1.__generator(this, function (_a) {
|
16 | switch (_a.label) {
|
17 | case 0:
|
18 | _a.trys.push([0, 2, , 3]);
|
19 | return [4 , execa(cmd, args)];
|
20 | case 1:
|
21 | _a.sent();
|
22 | return [2 , true];
|
23 | case 2:
|
24 | e_1 = _a.sent();
|
25 | return [2 , false];
|
26 | case 3: return [2 ];
|
27 | }
|
28 | });
|
29 | });
|
30 | }
|
31 | exports.default = isCmdInstalled;
|
32 |
|
\ | No newline at end of file |