UNPKG

koneko-cli

Version:

Your CLI for reading manga from the terminal

42 lines (41 loc) 1.73 kB
"use strict"; // Function to detect browser path based on environment or settings function getBrowserExecutable() { const browser = process.env.BROWSER || 'chrome'; switch (browser.toLowerCase()) { case 'brave': if (process.platform === 'win32') { return "C:\\Program Files\\BraveSoftware\\Brave-Browser\\Application\\brave.exe"; } if (process.platform === 'darwin') { return "/Applications/Brave Browser.app/Contents/MacOS/Brave Browser"; } if (process.platform === 'linux') { return "/usr/bin/brave"; } break; case 'chrome': if (process.platform === 'win32') { return "C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe"; } if (process.platform === 'darwin') { return "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"; } if (process.platform === 'linux') { return "/usr/bin/google-chrome-stable"; } break; default: console.log("Browser not found. Defaulting to Chrome."); if (process.platform === 'win32') { return "C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe"; } if (process.platform === 'darwin') { return "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"; } if (process.platform === 'linux') { return "/usr/bin/google-chrome-stable"; } } return undefined; // Fallback to undefined if no match }