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) { if (self.opened) {
return next(); return next();
} }
function reportAvailable(next) { self.opened = true;
next(null, __("webserver available at") + self.events.request('open-browser', next);
" " +
("http://" + canonicalHost(self.hostname) +
":" + self.port).bold.underline.green, self.port);
} }
], 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) { stop(callback) {