From e31f4778ac4f269a81cc082640baa81a5abafbab Mon Sep 17 00:00:00 2001 From: Anthony Laibe Date: Fri, 31 Aug 2018 12:00:16 +0100 Subject: [PATCH] Handle string --- lib/modules/console/index.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/modules/console/index.js b/lib/modules/console/index.js index 2ad53b9f..00fef4b2 100644 --- a/lib/modules/console/index.js +++ b/lib/modules/console/index.js @@ -32,6 +32,9 @@ class Console { let plugin = this.plugins.createPlugin('consoleApi', {}); plugin.registerAPICall('post', '/embark-api/command', (req, res) => { this.executeCmd(req.body.command, (_err, result) => { + if (typeof result === 'string') { + return res.send({result}); + } res.send({result: stringify(result, null, 2)}); }); });