MCPcopy
hub / github.com/iterative/cml / parse

Function parse

src/utils.js:210–222  ·  view source on GitHub ↗
(line)

Source from the content-addressed store, hash-verified

208 const tfProc = require('child_process').spawn(command, args, options);
209 tfProc.stdout.on('data', (buf) => {
210 const parse = (line) => {
211 if (line === '') return;
212 try {
213 const { '@level': level, '@message': message } = JSON.parse(line);
214 if (level === 'error') {
215 logger.error(`terraform error: ${message}`);
216 } else {
217 logger.info(message);
218 }
219 } catch (err) {
220 logger.info(line);
221 }
222 };
223 buf.toString('utf8').split('\n').forEach(parse);
224 });
225 tfProc.stderr.on('data', (buf) => {

Callers 1

deterministicFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected