X-Git-Url: https://git.r.bdr.sh/rbdr/tomato-sauce/blobdiff_plain/a41763dd463339765081c1f968a7b93b8ccf572f..226ad561a01402590ebf3fa61912fd5d8f93f632:/bin/tomato_sauce.js?ds=inline diff --git a/bin/tomato_sauce.js b/bin/tomato_sauce.js index 5a416d5..efe71a3 100755 --- a/bin/tomato_sauce.js +++ b/bin/tomato_sauce.js @@ -19,23 +19,30 @@ const config = { const screenPath = Getenv('TOMATO_SAUCE_SCREEN_PATH', Path.join(__dirname, '../lib/screens')); const rendererPath = Getenv('TOMATO_SAUCE_RENDERER_PATH', Path.join(__dirname, '../lib/renderers')); -Util.loadFiles(screenPath).then(function (screens) { +Util.loadFiles(screenPath).then((screens) => { + config.screens = screens; return Util.loadFiles(rendererPath); -}).then(function (renderers) { - config.renderers = renderers; -}).then(function () { - let tomatoSauce = new TomatoSauce(config); - - tomatoSauce.on('listening', function (event) { - const address = event.data.server.address(); - console.log(`Tomato Sauce listening on: ${address.address}:${address.port}`); - }); +}) + .then((renderers) => { - tomatoSauce.on('error', function (error) { - console.error(error.stack || error.message || error); - process.exit(1); - }); + config.renderers = renderers; + }) + .then(() => { + + const tomatoSauce = new TomatoSauce(config); + + tomatoSauce.on('listening', (event) => { - tomatoSauce.run(); -}); + const address = event.data.server.address(); + console.log(`Tomato Sauce listening on: ${address.address}:${address.port}`); + }); + + tomatoSauce.on('error', (error) => { + + console.error(error.stack || error.message || error); + process.exit(1); + }); + + tomatoSauce.run(); + });