Skip to content

Commit

Permalink
Merge pull request #5 from Florian7843/fix/raw
Browse files Browse the repository at this point in the history
fix(raw): remove quotes and newline from raw
  • Loading branch information
Florian7843 authored Sep 9, 2021
2 parents 2fee703 + d1d28d6 commit 718988f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/bin/hgjson.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const client = new HargassnerTelnet(argv.ip, argv.port, {
})

client.on('data', (data) => {
console.log(argv.formatted ? data : JSON.stringify(data))
console.log(argv.formatted || argv.raw ? data : JSON.stringify(data))
// Handle --once
if (argv.once) process.exit(0)
})
Expand Down
2 changes: 1 addition & 1 deletion src/hargassnerTelnet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export class HargassnerTelnet {
data = this.parse(dataSplit)
} else {
// Raw set just return the string
data = buffer.toString()
data = buffer.toString().replace(/(.*) \r\n/g, '$1')
}

this.callbacks.data?.forEach((callback) => callback(data))
Expand Down

0 comments on commit 718988f

Please sign in to comment.