Skip to content
This repository has been archived by the owner on Aug 1, 2020. It is now read-only.

Commit

Permalink
Silence max-listeners warning
Browse files Browse the repository at this point in the history
  • Loading branch information
Tyler Mills committed Sep 14, 2018
1 parent 55605a3 commit 59de119
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,15 @@
'use strict';

module.exports = lando => {
const NODE_VERSION = 8;
const LANDO_NODE_VERSION = parseFloat(process.version.replace('v', ''));
lando.incrementMaxListeners = () => {
lando.events.setMaxListeners(lando.events.getMaxListeners() + 1);
return lando;
};

lando.validateLandoVersion = () => {
const LANDO_NODE_VERSION = parseFloat(process.version.replace('v', ''));
const NODE_VERSION = 8;

const validateLandoVersion = () => {
if (LANDO_NODE_VERSION < NODE_VERSION) {
lando.log.error('The Alfred Workflow module expects the Lando Node version to be' +
` ${NODE_VERSION} but instead got ${LANDO_NODE_VERSION}.`
Expand All @@ -19,9 +24,9 @@ module.exports = lando => {
}
};

validateLandoVersion();

lando.validateLandoVersion();
lando.alfredWorkflow = require('./package.json');

const allowWorkflowTasks = [
// Production workflow
(process.env.alfred_workflow_bundleid === 'com.landoflow.workflow').toString(),
Expand All @@ -37,7 +42,7 @@ module.exports = lando => {
};

// Add in our app tasks
lando.events.on('post-bootstrap', 5, lando => {
lando.incrementMaxListeners().events.on('post-bootstrap', 5, lando => {
lando.tasks.add('alfred', require('./src/tasks/alfred/install')(lando));

if (!allowWorkflowCommands()) {
Expand Down

0 comments on commit 59de119

Please sign in to comment.