Skip to content

Commit

Permalink
Merge pull request #45 from jarretlavallee/fix/master/stdin_multiple_…
Browse files Browse the repository at this point in the history
…hashes

Allow for handling multiple hashes with STDIN
  • Loading branch information
Thomas Kishel authored Feb 18, 2020
2 parents 0f3a3fd + 3e34526 commit 6f67271
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions files/json2timeseriesdb
Original file line number Diff line number Diff line change
Expand Up @@ -378,9 +378,10 @@ end

if ARGF.filename == '-'
begin
converted_data = parse_input( JSON.parse(ARGF.read) )
input = ARGF.read
converted_data = input.lines.map { |l| parse_input( JSON.parse(l) )}
if $options[:host]
$net_output.write(converted_data)
$net_output.write(converted_data.flatten.join("\n"))
else
STDOUT.puts(converted_data)
end
Expand Down

0 comments on commit 6f67271

Please sign in to comment.