piral-cli
Version:
The standard CLI for creating and building a Piral instance or a Pilet.
23 lines • 738 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.openBrowserAt = openBrowserAt;
exports.openBrowser = openBrowser;
const external_1 = require("../external");
const log_1 = require("./log");
const config_1 = require("./config");
async function openBrowserAt(address) {
try {
await (0, external_1.open)(address);
}
catch (err) {
(0, log_1.log)('failedToOpenBrowser_0170', err);
}
}
async function openBrowser(shouldOpen, port, path, https) {
if (shouldOpen) {
const scheme = https ? 'https' : 'http';
const address = `${scheme}://${config_1.config.host}:${port}${path}`;
await openBrowserAt(address);
}
}
//# sourceMappingURL=browser.js.map