Skip to content

Commit

Permalink
make sure we only return the key instead of the rest of the output
Browse files Browse the repository at this point in the history
  • Loading branch information
ylebre committed Nov 16, 2022
1 parent 6885888 commit d1f0a3c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion timeld/init.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,20 @@ setTimeout(function() {
return code;
})
.then(function(code) {
var receivedLines = '';
p.stdin.write(code + "\n");
setTimeout(function() {
p.stdout.on('data',function (data) {
console.log(data.toString())
receivedLines += data.toString();
p.stdout.on('data',function (data) {
});
});
p.stdin.write("key\n");
p.stdin.write("exit\n");
p.stdin.end();
setTimeout(function() {
console.log(receivedLines.split("\n")[0]);
}, 1000);
}, 1000);
});
}, 4000);
Expand Down

0 comments on commit d1f0a3c

Please sign in to comment.