Skip to content

Commit

Permalink
feat: update stream configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
gajus committed May 8, 2021
1 parent cb8cecd commit 695338b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/bin/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ const chalk = new Chalk({
level: argv['use-colors'] ? 3 : 0,
});

let streamConfiguration;
let socket;

if (argv['api-key']) {
Expand All @@ -115,11 +116,15 @@ if (argv['api-key']) {
version: '1.0.0',
},
});

socket.on('stream_configuration', (nextStreamConfiguration) => {
streamConfiguration = nextStreamConfiguration;
});
}

let stream = process.stdin
.pipe(split((line) => {
if (socket) {
if (socket && streamConfiguration.enabled) {
socket.emit('log', line);
}

Expand Down

0 comments on commit 695338b

Please sign in to comment.