Skip to content

Commit

Permalink
Fix markdown reporting bug
Browse files Browse the repository at this point in the history
  • Loading branch information
worksofliam committed Feb 1, 2024
1 parent 17e8da3 commit b53c41c
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions cli/src/builders/imd.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,9 @@ export class ImpactMarkdown {
let currentTree: ILEObject[] = [];

function lookupObject(ileObject: ILEObject) {
lines.push(`${''.padEnd(currentTree.length, `\t`)}* ${TypeEmoji[ileObject.type] || `❔`} \`${ileObject.systemName}.${ileObject.type}\` (${ileObject.relativePath ? `\`${ileObject.relativePath}\`` : `no source`})`);
let resultLines: string[] = [];

resultLines.push(`${''.padEnd(currentTree.length, `\t`)}* ${TypeEmoji[ileObject.type] || `❔`} \`${ileObject.systemName}.${ileObject.type}\` (${ileObject.relativePath ? `\`${ileObject.relativePath}\`` : `no source`})`);

currentTree.push(ileObject);

Expand All @@ -120,20 +122,23 @@ export class ImpactMarkdown {
const circular = currentTree.some(d => d.systemName === target.systemName && d.type === target.type);

if (containsLookup && !circular) {
lookupObject(target);
resultLines.push(...lookupObject(target));
}
}

currentTree.pop();
return resultLines;
}

lookupObject(theObject);
const depTreeMd = lookupObject(theObject);

if (lines.length === 1) {
if (depTreeMd.length === 1) {
lines.push(
``,
`Changes to this object have no impact.`
)
} else {
lines.push(...depTreeMd);
}

return lines;
Expand All @@ -149,7 +154,7 @@ export class ImpactMarkdown {

let logs = this.targets.logger.getLogsFor(ileObject.relativePath);
let parents = this.targets.getTargets().filter(t => t.deps.some(d => d.systemName === ileObject.systemName && d.type === ileObject.type));
let children = this.targets.getTarget(ileObject).deps;
let children = this.targets.getTarget(ileObject)?.deps || [];

lines.push(`| ` + [
TypeEmoji[ileObject.type] || `❔`,
Expand Down

0 comments on commit b53c41c

Please sign in to comment.