fail silently if opn doesn't work

This commit is contained in:
Michael Bradley, Jr 2018-08-31 11:16:57 -05:00
parent 72943dc0e5
commit 4f8107bf17
1 changed files with 4 additions and 1 deletions

View File

@ -47,7 +47,10 @@ class Server {
("http://" + canonicalHost(this.hostname) +
":" + this.port).bold.underline.green, this.port);
if (!opened) {
opn(`http://${canonicalHost(this.hostname)}:${this.port}`);
// fail silently, e.g. in a docker container, by cacthing promise
// rejection w/ a noop
opn(`http://${canonicalHost(this.hostname)}:${this.port}`)
.catch(function () {});
opened = true;
}
});