fixes
This commit is contained in:
@@ -11,13 +11,17 @@ class TailVinyl extends Vinyl {
|
||||
constructor(params) {
|
||||
params.contents = new Transform();
|
||||
super(params);
|
||||
this.tail = new Tail(params.path);
|
||||
this.tail.on('line', data => this.contents.write(data + '\n'));
|
||||
this.tail.on('error', error => this.contents.write('error: ' + error));
|
||||
if (params.path) {
|
||||
this.tail = new Tail(params.path);
|
||||
this.tail.on('line', data => this.contents.write(data + '\n'));
|
||||
this.tail.on('error', error => this.contents.write('error: ' + error));
|
||||
}
|
||||
}
|
||||
|
||||
dispose() {
|
||||
this.tail.unwatch();
|
||||
if (this.tail) {
|
||||
this.tail.unwatch();
|
||||
}
|
||||
this.contents.destroy();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user