1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
| "use strict";
| Object.defineProperty(exports, "__esModule", { value: true });
| const child_process_1 = require("child_process");
| const fileNameList = ['google-chrome', 'chromium-browser'];
| function getChromePath() {
| return new Promise((resolve, reject) => {
| child_process_1.exec(`which ${fileNameList[0]}`, (err, stdout, stderr) => {
| if (!err) {
| const chromePath = stdout.replace(/\n/g, '');
| resolve(chromePath);
| return;
| }
| fileNameList.shift();
| if (!fileNameList[0]) {
| reject(err);
| }
| else {
| getChromePath().then(resolve, reject);
| }
| });
| });
| }
| function lookupChromeLinux() {
| return getChromePath();
| }
| exports.default = lookupChromeLinux;
|
|