-
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
7 changed files
with
34 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
# editorconfig.org | ||
root = true | ||
|
||
[*] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
#!/usr/bin/env node | ||
'use strict'; | ||
require('./').run(); | ||
require('./')(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,32 @@ | ||
'use strict'; | ||
var chalk = require('chalk'); | ||
var requireall = require('require-dir'); | ||
var objectValues = require('object-values'); | ||
var async = require('async'); | ||
var eachAsync = require('each-async'); | ||
var symbols = require('log-symbols'); | ||
var rules = require('./rules'); | ||
|
||
module.exports = { | ||
rules: requireall('./rules'), | ||
module.exports = function () { | ||
var errCount = 0; | ||
|
||
run: function () { | ||
this.errorCount = 0; | ||
console.log('\n' + chalk.underline.blue('Yeoman Doctor')); | ||
console.log('Running sanity checks on your system\n'); | ||
async.map(objectValues(this.rules), this.processRule.bind(this), this.onEnd.bind(this)); | ||
}, | ||
console.log('\n' + chalk.underline.blue('Yeoman Doctor')); | ||
console.log('Running sanity checks on your system\n'); | ||
|
||
processRule: function (rule, cb) { | ||
rule.verify(function (error) { | ||
this.logResult(rule.description, error); | ||
cb(); | ||
}.bind(this)); | ||
}, | ||
eachAsync(objectValues(rules), function (rule, i, cb) { | ||
rule.verify(function (err) { | ||
console.log(err ? symbols.error : symbols.success + ' ' + rule.description); | ||
|
||
if (err) { | ||
errCount++; | ||
console.log(err); | ||
} | ||
|
||
onEnd: function (err) { | ||
if (this.errorCount === 0) { | ||
cb(); | ||
}); | ||
}, function () { | ||
if (errCount === 0) { | ||
console.log(chalk.green('\nEverything looks all right!')); | ||
} else { | ||
console.log(chalk.red('\nFound potential issues on your machine :(')); | ||
} | ||
}, | ||
|
||
logResult: function (description, error) { | ||
console.log(error ? symbols.error : symbols.success + ' ' + description); | ||
|
||
if (error) { | ||
this.errorCount++; | ||
console.log(error); | ||
} | ||
} | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
'use strict'; | ||
exports['bowerrc-home'] = require('./bowerrc-home'); | ||
exports['global_config'] = require('./global_config'); | ||
exports['node_path'] = require('./node_path'); | ||
exports['yo-rc-home'] = require('./yo-rc-home'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters