Skip to content

Commit

Permalink
loosen up emfile check in grunt hook + minor changes re code conventi…
Browse files Browse the repository at this point in the history
…ons.
  • Loading branch information
mikermcneil committed Jun 8, 2016
1 parent 2fe75c0 commit ac91e9d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/hooks/grunt/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ module.exports = function(sails) {
// (otherwise, we've already triggered the callback at this point, when the task started)
if (sails.config.environment === 'production') {
if (_.isFunction(cb_afterTaskStarted)) { return cb_afterTaskStarted(); }
else sails.log.verbose('`runTask()` could not find a Gruntfile.');
else { sails.log.verbose('`runTask()` could not find a Gruntfile.'); }
}
return;
} // </console message contains "Unable to find Gruntfile">
Expand All @@ -213,7 +213,7 @@ module.exports = function(sails) {
} // </console message contains "Aborted due to warnings">

// "Warning: EMFILE"
else if (consoleMsg.match(/Warning: EMFILE/)){
else if (consoleMsg.match(/EMFILE/ig)){
sails.log.error('** Grunt :: An EMFILE error occurred. **');
sails.log.error(
'Usually this means there are too many files open as per your system settings.\n'+
Expand Down Expand Up @@ -289,7 +289,7 @@ module.exports = function(sails) {
// task was first run)
if (sails.config.environment === 'production') {
if (_.isFunction(cb_afterTaskStarted)) { return cb_afterTaskStarted(); }
else sails.log.verbose('`runTask()` has finished the Grunt task.');
else { sails.log.verbose('`runTask()` has finished the Grunt task.'); }
}
}); //</when child process exits>

Expand All @@ -305,7 +305,7 @@ module.exports = function(sails) {
'or there is a bug in Sails core. If you expect the latter, please file an issue in the GitHub repo.'
);
if (_.isFunction(cb_afterTaskStarted)) { return cb_afterTaskStarted(consistencyViolationErr); }
else sails.log.error(consistencyViolationErr);
else { sails.log.error(consistencyViolationErr); }
}
sails.childProcesses.push(child);

Expand All @@ -320,7 +320,7 @@ module.exports = function(sails) {
// and fire it here.
if (sails.config.environment !== 'production') {
if (_.isFunction(cb_afterTaskStarted)) { return cb_afterTaskStarted(); }
else sails.log.verbose('`runTask()` has started the Grunt task.');
else { sails.log.verbose('`runTask()` has started the Grunt task.'); }
}
}
};
Expand Down

0 comments on commit ac91e9d

Please sign in to comment.