Alberto Maturano 154fc28a57 Normalize to standar file permissions
As a result of taking a look on PR #1967 I realized there is 819
executable files in this repository. It is obvious this is an error.
2018-09-24 12:33:09 -05:00

19 lines
545 B
JavaScript

/**
* componentExists
*
* Check whether the given component exist in either the components or containers directory
*/
const fs = require('fs');
const path = require('path');
const pageComponents = fs.readdirSync(path.resolve(process.cwd(), 'admin', 'src', 'components'));
const pageContainers = fs.readdirSync(path.resolve(process.cwd(), 'admin', 'src', 'containers'));
const components = pageComponents.concat(pageContainers);
function componentExists(comp) {
return components.indexOf(comp) >= 0;
}
module.exports = componentExists;