diff --git a/embark-ui/src/actions/index.js b/embark-ui/src/actions/index.js index 70a21173..99c4f7a4 100644 --- a/embark-ui/src/actions/index.js +++ b/embark-ui/src/actions/index.js @@ -1,4 +1,5 @@ import {EMBARK_PROCESS_NAME} from '../constants'; +import {ansiToHtml} from '../utils/utils'; export const REQUEST = 'REQUEST'; export const SUCCESS = 'SUCCESS'; @@ -99,7 +100,7 @@ export const commands = { return action(COMMANDS[SUCCESS], {processLogs: [{ timestamp: new Date().getTime(), name: EMBARK_PROCESS_NAME, - msg: `${payload.command} > ${command.result}` + msg: `console> ${payload.command}
${ansiToHtml(command.result)}` }]}) }, failure: (error) => action(COMMANDS[FAILURE], {error}) diff --git a/embark-ui/src/utils/utils.js b/embark-ui/src/utils/utils.js index 86fb7b95..4e71c95f 100644 --- a/embark-ui/src/utils/utils.js +++ b/embark-ui/src/utils/utils.js @@ -12,3 +12,9 @@ export function hashCode(str) { } return hash; } + +export function ansiToHtml(text) { + const Convert = require('ansi-to-html'); + const convert = new Convert(); + return convert.toHtml(text.replace(/\n/g,'
')) +}