UNPKG

sf-decomposer

Version:

Break down large Salesforce metadata files into smaller, more manageable files for version control and then recreate deployment-compatible files.

30 lines 853 B
'use strict'; import { readFile } from 'node:fs/promises'; export async function readOriginalLogFile(logFile) { let originalLog; try { originalLog = (await readFile(logFile, 'utf-8')).split('\n'); } catch (err) { originalLog = []; } return originalLog; } export async function checkLogForErrors(logFile, originalLogContents) { let currentLog; const newErrors = []; try { currentLog = (await readFile(logFile, 'utf-8')).split('\n'); } catch (err) { return newErrors; } for (const line of currentLog) { if (!originalLogContents.includes(line) && line.includes('[ERROR]')) { const errorMessage = line.split('default - ')[1]; newErrors.push(errorMessage); } } return newErrors; } //# sourceMappingURL=checkLogforErrors.js.map