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); }); }