Skip to content

Commit

Permalink
fix: fix broken cli stack analysis summary option
Browse files Browse the repository at this point in the history
Signed-off-by: Zvi Grinberg <zgrinber@redhat.com>
  • Loading branch information
zvigrinberg committed Mar 6, 2024
1 parent 7cea8ce commit cddea9f
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion src/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,26 @@ const stack = {
let manifest = args['/path/to/manifest']
let html = args['html']
let summary = args['summary']
let theProvidersSummary = new Map();
let theProvidersObject ={}
let res = await exhort.stackAnalysis(manifest, html)
if(summary)
{
for (let provider in res.providers ) {
if (res.providers[provider].sources !== undefined) {
for(let source in res.providers[provider].sources ) {
if(res.providers[provider].sources[source].summary) {
theProvidersSummary.set(source,res.providers[provider].sources[source].summary)
}
}
}
}
for (let [provider, providerSummary] of theProvidersSummary) {
theProvidersObject[provider]=providerSummary
}
}
console.log(html ? res : JSON.stringify(
!html && summary ? res['summary'] : res,
!html && summary ? theProvidersObject : res,
null,
2
))
Expand Down

0 comments on commit cddea9f

Please sign in to comment.