1 | "use strict";
|
2 |
|
3 | var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4 |
|
5 | var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
6 |
|
7 | const opn = require('opn');
|
8 |
|
9 | const openInBrowser =
|
10 |
|
11 | function () {
|
12 | var _ref = (0, _asyncToGenerator2.default)(function* (url, browser) {
|
13 | try {
|
14 | const options = typeof browser === 'string' ? {
|
15 | app: browser
|
16 | } : undefined;
|
17 | yield opn(url, options);
|
18 | } catch (err) {
|
19 | console.error(`Unexpected error while opening in browser: ${browser}`);
|
20 | console.error(err);
|
21 | }
|
22 | });
|
23 |
|
24 | return function openInBrowser(_x, _x2) {
|
25 | return _ref.apply(this, arguments);
|
26 | };
|
27 | }();
|
28 |
|
29 | module.exports = openInBrowser; |
\ | No newline at end of file |