Skip to content

Commit

Permalink
ci: fix docs replacer (#529)
Browse files Browse the repository at this point in the history
  • Loading branch information
zepatrik committed Apr 6, 2021
1 parent b7845ae commit 44974fe
Show file tree
Hide file tree
Showing 2 changed files with 18,522 additions and 19 deletions.
19 changes: 16 additions & 3 deletions docs/config.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,28 @@
const replaceInDir = ({ dir, replacer }) =>
new Proxy(
const replaceInDir = ({ dir, replacer }) => {
const { join } = require('path')
const fs = require('fs')

const walk = (dir) =>
fs.readdirSync(dir).flatMap((fn) => {
const fp = join(dir, fn)
if (fs.statSync(fp).isDirectory()) {
return walk(fp)
}
return fp
})

return new Proxy(
{ replacer },
{
get: (target, p) => {
if (p === 'files') {
return require('fs').readdirSync(dir)
return walk(dir)
}
return target[p]
}
}
)
}

module.exports = {
projectName: 'ORY Keto',
Expand Down

0 comments on commit 44974fe

Please sign in to comment.