Skip to content

Commit

Permalink
Added chaining to run, simplyfied exports.run
Browse files Browse the repository at this point in the history
  • Loading branch information
indutny committed Sep 28, 2010
1 parent 1861dbc commit 73b52a4
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions lib/forever.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,15 @@ Forever.prototype.run = function () {
self.emit('exit', null, self);
}
});

// Chaining support
return this;
};

// Export the Forever object
exports.Forever = Forever;

// Export the core 'run' method
exports.run = function (file, options) {
var forever = new Forever(file, options);
forever.run();
return forever;
};
return new Forever(file, options).run();
};

0 comments on commit 73b52a4

Please sign in to comment.