mirror of https://github.com/thumbsup/thumbsup
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
663 B
JavaScript
27 lines
663 B
JavaScript
6 years ago
|
const warn = require('debug')('thumbsup:warn')
|
||
|
const messages = require('../bin/messages')
|
||
|
|
||
|
/*
|
||
|
Keeps track of which source files we failed to process
|
||
|
*/
|
||
|
module.exports = class Problems {
|
||
|
constructor () {
|
||
|
this.files = {}
|
||
|
}
|
||
|
|
||
|
addFile (path) {
|
||
|
this.files[path] = true
|
||
|
}
|
||
|
|
||
|
print () {
|
||
|
// only print the number of failed files in the standard output
|
||
|
const paths = Object.keys(this.files)
|
||
|
if (paths.length > 0) {
|
||
|
// print a short summary on stdout
|
||
|
console.warn(messages.PROBLEMS(paths.length))
|
||
|
// and a full log to the log file
|
||
|
warn('The following sources files were not processed:\n' + paths.join(','))
|
||
|
}
|
||
|
}
|
||
|
}
|