diff --git a/lib/dashboard/dashboard.js b/lib/dashboard/dashboard.js index 029b14e85..641c672be 100644 --- a/lib/dashboard/dashboard.js +++ b/lib/dashboard/dashboard.js @@ -1,16 +1,28 @@ let async = require('async'); +let windowSize = require('window-size'); let Monitor = require('./monitor.js'); let Console = require('./console.js'); class Dashboard { constructor(options) { + const self = this; this.logger = options.logger; this.events = options.events; this.plugins = options.plugins; this.version = options.version; this.env = options.env; this.contractsConfig = options.contractsConfig; + + this.events.on('firstDeploymentDone', this.checkWindowSize.bind(this)); + this.events.on('outputDone', this.checkWindowSize.bind(this)); + } + + checkWindowSize() { + let size = windowSize.get(); + if (size.height < 40 || size.width < 118) { + this.logger.warn(__("tip: you can resize the terminal or disable the dashboard with") + " embark run --nodashboard".bold.underline); + } } start(done) { diff --git a/lib/index.js b/lib/index.js index ca034230b..9e3c3c511 100644 --- a/lib/index.js +++ b/lib/index.js @@ -68,7 +68,6 @@ class Embark { let self = this; self.context = options.context || [constants.contexts.run, constants.contexts.build]; let Dashboard = require('./dashboard/dashboard.js'); - let windowSize = require('window-size'); let engine = new Engine({ env: options.env, @@ -153,11 +152,6 @@ class Embark { engine.logger.info(err.stack); } else { engine.events.emit('firstDeploymentDone'); - - let size = windowSize.get(); - if (size.height < 40 || size.width < 118) { - engine.logger.warn(__("tip: you can resize the terminal or disable the dashboard with") + " embark run --nodashboard".bold.underline); - } } }); }