Skip to content

Commit

Permalink
Merge pull request #563 from olgn/cli-err-warn-text-disctinction
Browse files Browse the repository at this point in the history
indicate issue severity in console output of cli
  • Loading branch information
olgn authored Sep 14, 2018
2 parents cff50f9 + 0a962e1 commit f42ffe3
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ module.exports = function(dir, options) {
if (issues.errors.length === 1 && issues.errors[0].code === '61') {
console.log(
colors.red(
'The directory ' +
'[ERR] The directory ' +
dir +
' failed an initial Quick Test. This means the basic names and structure of the files and directories do not comply with BIDS specification. For more info go to http://bids.neuroimaging.io/',
),
)
} else if (issues.config && issues.config.length >= 1) {
console.log(colors.red('Invalid Config File'))
console.log(colors.red('[ERR] Invalid Config File'))
for (var i = 0; i < issues.config.length; i++) {
var issue = issues.config[i]
issue.file.file = { relativePath: issue.file.path }
Expand Down Expand Up @@ -58,14 +58,16 @@ module.exports = function(dir, options) {
}

function logIssues(issues, color, options) {
const severity = color == 'red' ? 'ERR' : 'WARN'
for (var i = 0; i < issues.length; i++) {
var issue = issues[i]
const issue = issues[i]
const issueNumber = i + 1
console.log(
'\t' +
colors[color](
i +
1 +
issueNumber +
': ' +
`[${severity}] ` +
issue.reason +
' (code: ' +
issue.code +
Expand Down

0 comments on commit f42ffe3

Please sign in to comment.