Browse Source

return and minor fixes

Artur Paikin 9 years ago
parent
commit
4216c86200
1 changed files with 7 additions and 7 deletions
  1. 7 7
      src/core/Core.js

+ 7 - 7
src/core/Core.js

@@ -98,7 +98,7 @@ export default class Core {
  */
   run () {
     console.log({
-      class: 'Core',
+      class: this.constructor.name,
       method: 'run'
     })
 
@@ -107,19 +107,19 @@ export default class Core {
       this.opts.autoProceed = false
     }
 
-    // Each Plugin can have `run` and/or `install` methods
-    // `install` adds event listeners and does some non-blocking work, useful for `progress`
+    // Each Plugin can have `run` and/or `install` methods.
+    // `install` adds event listeners and does some non-blocking work, useful for `progress`,
     // `run` waits for the previous step to finish (user selects files) before proceeding
-    ['install', 'run'].forEach(method => {
+    return ['install', 'run'].forEach(method => {
       // First we select only plugins of current type,
       // then create an array of runType methods of this plugins
-      let typeMethods = this.types.filter(type => {
+      const typeMethods = this.types.filter(type => {
         return this.plugins[type]
       }).map(type => this.runType.bind(this, type, method))
 
       // Run waterfall of typeMethods
-      Utils.promiseWaterfall(typeMethods)
-        .then(result => console.log(result))
+      return Utils.promiseWaterfall(typeMethods)
+        .then(result => result)
         .catch(error => console.error(error))
     })
   }