1
0
mirror of https://github.com/Pomax/BezierInfo-2.git synced 2025-08-08 17:57:05 +02:00

make sure the right files are ignored. and not ignored

This commit is contained in:
Pomax
2017-03-26 11:33:57 -07:00
parent 4b5a68cc88
commit 9b985175e7
4 changed files with 73 additions and 5 deletions

View File

@@ -14,11 +14,15 @@ var jsxshim = require("./lib/jsx-shim");
const BASEDIR = path.join(__dirname, "..");
var index = require(path.join(BASEDIR, "components/sections"));
console.log(index);
var handlers = [];
Object.keys(index).forEach( section => {
var handlerFile = path.join(BASEDIR, `components/sections/${section}/handler.js`);
var hasHandler = false;
var withKeys = false;
if (fs.existsSync(handlerFile)) {
hasHandler = true;
let content = fs.readFileSync(handlerFile).toString();
@@ -38,5 +42,6 @@ Object.keys(index).forEach( section => {
`module.exports = generateBase("${section}");`
].filter(l => !!l).join('\n');
console.log(`writing ${section}`);
fs.writeFileSync(path.join(BASEDIR,`components/sections/${section}/index.js`), indexCode);
});