Skip to content

Commit 73b52a4

Browse files
committed
Added chaining to run, simplyfied exports.run
1 parent 1861dbc commit 73b52a4

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

lib/forever.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,15 @@ Forever.prototype.run = function () {
5555
self.emit('exit', null, self);
5656
}
5757
});
58+
59+
// Chaining support
60+
return this;
5861
};
5962

6063
// Export the Forever object
6164
exports.Forever = Forever;
6265

6366
// Export the core 'run' method
6467
exports.run = function (file, options) {
65-
var forever = new Forever(file, options);
66-
forever.run();
67-
return forever;
68-
};
68+
return new Forever(file, options).run();
69+
};

0 commit comments

Comments
 (0)