function getPipExe() { const pip = which.sync("pip3", { nothrow: true }) || which.sync("pip", { nothrow: true }); if (pip) { return pip; } // try python -m pip const pythonExe = getPythonExe(); return new Promise((resolve, reject) => { var child = spawn(pythonExe, ["-m", "pip"]); child.on("close", code => { if (code === 0) resolve([pythonExe, "-m", "pip"]); else resolve(); }); }); }
const startOpenvpn = (options = []) => { logger.info('Starting openvpn...'); const openvpn = `"${which.sync('openvpn')}"`; const proc = execa(openvpn, ['--config', `"${filePath}"`].concat(options), { shell: true }); proc.stdout.pipe(logger.stream); proc.stderr.on('data', data => logger.error(data.toString())); proc.on('close', code => logger.info(`child process exited with code ${code}`)); process.on('exit', () => proc.kill()); process.on('SIGINT', () => proc.kill()); return proc; }
async function findInPath () { return new Promise((resolve, reject) => { const keys = Object.keys(cmd); for (const key of keys) { try { cmd[key] = which.sync(key); } catch (err) { if (isDramatic(err.toString())) { return reject(new Error('Warning: tools.findInPath: ' + err)); } } } resolve(); }); }
if (which.sync(browser, { nothrow: true })) { return resolve(); } else {
this._isNinjaAvailable = false; try { if (which.sync("ninja")) { this._isNinjaAvailable = true; this._isMakeAvailable = false; try { if (which.sync("make")) { this._isMakeAvailable = true; this._isGPPAvailable = false; try { if (which.sync("g++")) { this._isGPPAvailable = true; this._isClangAvailable = false; try { if (which.sync("clang++")) { this._isClangAvailable = true;
return which.sync(pythonName, { path : _sofficeActualDirectory }); _whichSoffice = which.sync(sofficeName, { path : paths.join(':'), nothrow : true }) || which.sync(sofficeName, { nothrow : true }) || null; (paths.length > 0 && which.sync('python3', { path : paths.join(':'), nothrow : true })) || (paths.length > 0 && which.sync('python', { path : paths.join(':'), nothrow : true })) || which.sync('python3', { nothrow : true }) || which.sync('python', { nothrow : true }) || null; return { soffice : _whichSoffice,