shareoverlan
Version:
Simple local file sharing over LAN.
28 lines • 807 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const openBrowserBasedOnOS = (url) => {
const { platform } = process;
const { exec } = require('child_process');
let command;
switch (platform) {
case 'win32':
command = `start ${url}`;
break;
case 'darwin':
command = `open ${url}`;
break;
case 'linux':
command = `xdg-open ${url}`;
break;
default:
console.log(`Unsupported platform: ${platform}`);
return;
}
exec(command, (error) => {
if (error) {
console.error(`Error opening browser: ${error}`);
}
});
};
exports.default = openBrowserBasedOnOS;
//# sourceMappingURL=openBrowserBasedOnOS.js.map