Add tail node binary mode test

This commit is contained in:
Dave Conway-Jones
2016-02-25 08:52:43 +00:00
parent d3a98dd355
commit 0d1543ee8a
2 changed files with 20 additions and 2 deletions

View File

@@ -28,7 +28,7 @@ module.exports = function(RED) {
this.filename = n.filename;
this.filetype = n.filetype || "text";
this.split = n.split;
this.split = n.split || false;
var node = this;
var err = "";
@@ -36,7 +36,7 @@ module.exports = function(RED) {
var tail = spawn("tail", ["-F", "-n", "0", this.filename]);
tail.stdout.on("data", function (data) {
var msg = { topic:node.filename };
if (this.filetype === "text") {
if (node.filetype === "text") {
if (node.split) {
// TODO: allow customisation of the line break - as we do elsewhere
var strings = data.toString().split("\n");