Skip to content

Commit

Permalink
add comment in build.js
Browse files Browse the repository at this point in the history
  • Loading branch information
james58899 committed Jun 27, 2018
1 parent 4a2fb5a commit 0a24c89
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions build.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,21 @@ const fs = require('fs')
const path = require('path');
const mkdirp = require('mkdirp');

const srcDir = './';
const outDir = 'out/';
const matcher = '/**/*.shtml';
const srcDir = './'; // shtml base dir
const outDir = 'out/'; // build output dir
const matcher = '/**/*.shtml'; // shtml file matcher

const parser = new ssi(srcDir, outDir, matcher);

// find all shtml file in srcDir
glob(srcDir + matcher, (err, match) => {
if (err) throw err;

// exclude node_module and inc dir
match.filter(i => !i.match('node_modules') && !i.match('/inc/')).forEach(file => {
console.log('Reading:', file);

// skip if parse failed
try {
const out = file.replace(srcDir, outDir).replace('.shtml', '.html');
const dir = path.dirname(out);
Expand Down

0 comments on commit 0a24c89

Please sign in to comment.