Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
charliegerard committed Nov 13, 2023
1 parent 83941c0 commit b48d5d3
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions lib/commands/info/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,13 +141,8 @@ async function fetchPackageData (pkgName, pkgVersion, { includeAllIssues }, spin
}

// Conclude the status of the API call

const severityCount = getSeverityCount(result.data, includeAllIssues ? undefined : 'high')

if (!objectSome(severityCount)) {
spinner.succeed('\nPackage has no issues')
}

return {
data: result.data,
severityCount,
Expand Down Expand Up @@ -176,10 +171,15 @@ async function fetchPackageData (pkgName, pkgVersion, { includeAllIssues }, spin
Object.entries(scoreResult).map(score => console.log(`- ${score[0]}: ${formatScore(score[1])}`))

// Package issues list
const issueSummary = formatSeverityCount(severityCount)
console.log('\n')
spinner[strict ? 'fail' : 'succeed'](`Package has these issues: ${issueSummary}`)
formatPackageIssuesDetails(data)
if (objectSome(severityCount)) {
const issueSummary = formatSeverityCount(severityCount)
console.log('\n')
spinner[strict ? 'fail' : 'succeed'](`Package has these issues: ${issueSummary}`)
formatPackageIssuesDetails(data)
} else {
console.log('\n')
spinner.succeed('Package has no issues')
}

// Link to issues list
const format = new ChalkOrMarkdown(!!outputMarkdown)
Expand Down

0 comments on commit b48d5d3

Please sign in to comment.