]> git.r.bdr.sh - rbdr/tomato-sauce/blobdiff - bin/tomato_sauce.js
Update Documentation
[rbdr/tomato-sauce] / bin / tomato_sauce.js
index 5a416d5fd8a1f209312c9a055d01cfe8c5ad4f94..efe71a3939ab90a62150adb01e9edaa00e45253a 100755 (executable)
@@ -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();
+  });