2020-04-07 00:19:58 +02:00
|
|
|
'use strict';
|
2021-03-30 01:45:48 +02:00
|
|
|
const upath = require('upath');
|
2020-04-07 00:19:58 +02:00
|
|
|
const sh = require('shelljs');
|
|
|
|
const renderPug = require('./render-pug');
|
|
|
|
|
2021-03-30 01:45:48 +02:00
|
|
|
const srcPath = upath.resolve(upath.dirname(__filename), '../src');
|
2020-04-07 00:19:58 +02:00
|
|
|
|
|
|
|
sh.find(srcPath).forEach(_processFile);
|
|
|
|
|
|
|
|
function _processFile(filePath) {
|
|
|
|
if (
|
|
|
|
filePath.match(/\.pug$/)
|
|
|
|
&& !filePath.match(/include/)
|
|
|
|
&& !filePath.match(/mixin/)
|
|
|
|
&& !filePath.match(/\/pug\/layouts\//)
|
|
|
|
) {
|
|
|
|
renderPug(filePath);
|
|
|
|
}
|
|
|
|
}
|