forked from AllAlgorithms/cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
19 additions
and
7 deletions.
There are no files selected for viewing
File renamed without changes.
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
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,5 +1,7 @@ | ||
/** | ||
* The All Algorithms C++ Validate.js | ||
* validate.js | ||
* | ||
* The All ▲lgorithms validator CLI | ||
* | ||
* Author: Carlos Abraham Hernandez | ||
* https://abranhe.com ([email protected]) | ||
|
@@ -9,6 +11,7 @@ | |
const glob = require('glob'); | ||
const path = require('path'); | ||
const decamelize = require('decamelize'); | ||
const chalk = require('chalk'); | ||
const shell = require('child_process').execSync; | ||
|
||
const getFiles = (src, callback) => { | ||
|
@@ -25,10 +28,12 @@ getFiles('../', (err, res) => { | |
return; | ||
} | ||
|
||
if(file !== decamelize(file)){ | ||
console.log('Don\'t follow the All ▲lgorithms structure. :/'); | ||
process.exit(); | ||
} | ||
if (file !== decamelize(file)) { | ||
console.log(`The file ${chalk.red(path.basename(file))} does not follow the correct style.`); | ||
// Stop when a file with wrong format is found | ||
throw new TypeError(`File project style does not follow the All ▲lgorithms structure.`); | ||
} | ||
console.log(`The file ${chalk.green(path.basename(file))} is ok.`); | ||
}); | ||
} | ||
}); | ||
}); |