Files
fitness_walk_nwnu/node_modules/chrome-simple-launcher/build/sniffer-linux.js
T
2026-09-08 20:28:54 +08:00

27 lines
826 B
JavaScript

"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;