run(lifecycle) {
    return new Promise((resolve) => {
      const hooks = this.sortHooks(lifecycle);

      this.sqz.cli.log.debug(`# Starting CLI lifecycle : [ ${hooks.join(colors.green(' , '))} ]`);

      Promise.each(hooks, (val) => {
        const hook = _.find(this.sqz.vars.hooks, { identifier : val });

        this.sqz.cli.log.debug(`# Running lifecycle event "${val}"`);

        if (!hook) {
          this.sqz.cli.log.error(`No hook available for the lifecycle event ${colors.blue.bold(val)}`);
        }

        const Class = require(`${hook.path}`);
        const fn    = new Class(this.sqz);

        if (typeof fn[hook.function] !== 'function') {
          this.sqz.cli.log.error(
            `No hook function ${colors.blue.bold(hook.function)} available on ${colors.blue.bold(hook.path)}`
          );
        }

        const ret = fn[hook.function]();

        if (!ret || typeof ret.then !== 'function') {
          this.sqz.cli.log.warn(`Function ${colors.blue.bold(hook.function)} for hook ${colors.blue.bold(hook.identifier)} should be a Promise`);
        }

        return ret;
      }).then(() => {
        this.sqz.cli.log.debug('CLI lifecycle finished.');
        resolve();
      });
    });
  }
Run each event from the lifecycle

@param {Array} lifecycle - lifecycle array