move reporting to final callback

This commit is contained in:
Michael Bradley, Jr 2018-09-04 08:20:58 -05:00
parent b67aa8cc2d
commit d4be16ba3c

View File

@ -48,13 +48,19 @@ class Server {
if (self.opened) {
return next();
}
function reportAvailable(next) {
next(null, __("webserver available at") +
" " +
("http://" + canonicalHost(self.hostname) +
":" + self.port).bold.underline.green, self.port);
self.opened = true;
self.events.request('open-browser', next);
}
], callback);
], function (err) {
if (err) {
return callback(err);
}
const msg = (
__('webserver available at') + ' ' +
('http://' + canonicalHost(self.hostname) + ':' + self.port).bold.underline.green
);
callback(null, msg, self.port);
});
}
stop(callback) {