From 124eb02e97427e2b954a8f5f0a877b9f45caf2c6 Mon Sep 17 00:00:00 2001 From: HugoPoi Date: Fri, 19 Feb 2021 23:52:30 +0100 Subject: [PATCH] feat: export as json --- bin/gopro-telemetry-exporter.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/bin/gopro-telemetry-exporter.js b/bin/gopro-telemetry-exporter.js index c9c09fb..59ca401 100755 --- a/bin/gopro-telemetry-exporter.js +++ b/bin/gopro-telemetry-exporter.js @@ -28,8 +28,11 @@ async function main(options) { }; } - goproTelemetry(res, _.omit(options, ['_', 'input', 'output']), telemetry => { - fs.writeFileSync(options.output, telemetry); + goproTelemetry(res, _.omit(options, ['_', 'input', 'output']), telemetryData => { + if (!_.isString(telemetryData)) { + telemetryData = JSON.stringify(telemetryData); + } + fs.writeFileSync(options.output, telemetryData); }); }