-
Notifications
You must be signed in to change notification settings - Fork 249
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add windows support #194
Add windows support #194
Conversation
@@ -14,7 +14,7 @@ | |||
|
|||
## Features | |||
|
|||
* log rotation | |||
* log rotation (not on windows!) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* log rotation (not on windows!) | |
* log rotation (not on Windows) |
@@ -16,43 +18,54 @@ function Tail(path, opts) { | |||
}; | |||
this._buffer = new CBuffer(options.buffer); | |||
|
|||
var stream; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
var stream; | |
let stream; |
followOpt = '-f'; | ||
} | ||
|
||
const tail = childProcess.spawn('tail', ['-n', options.buffer, followOpt].concat(path)); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/* Check if this os provides the `tail` command. */ | ||
const hasTailCommand = commandExistsSync('tail'); | ||
if (hasTailCommand) { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
} | ||
util.inherits(Tail, events.EventEmitter); | ||
|
||
Tail.prototype.getBuffer = function getBuffer() { | ||
return this._buffer.toArray(); | ||
}; | ||
|
||
module.exports = (path, options) => new Tail(path, options); | ||
module.exports = (path, options) => new Tail(path, options); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
module.exports = (path, options) => new Tail(path, options); | |
module.exports = (path, options) => new Tail(path, options); | |
Thanks. I will fix the minor issues once it's in the master. |
@mthenw Thanks! 🎉 🚀 |
fixes #111
see also #175