Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const opts = {
logger,
publishers: config.publishers,
plugins: config.plugins,
processors: config.processors,
fetch: createCachedFetch({})
}
const processor = createProcessor(opts)
const publisher = createPublisher(opts)
const files = await globby(args.input)
// eslint-disable-next-line
for (const path of files) {
try {
// eslint-disable-next-line
const contents: string = (await fs.readFile(path)).toString()
const vf = vfile({ path, contents })
// eslint-disable-next-line
const res = await processor(vf)
// console.log(report(res))
// eslint-disable-next-line
await publisher(vf)
} catch (err) {
logger.log({
type: 'celeste',
level: 'error',
payload: { err, stack: err.stack }
})
}
}
return logger
async function getDoc(id) {
if (!id) {
return null;
}
const file = resolve(id);
if (!await exists(file)) {
return null;
}
return vfile({
path: path.posix.relative("./patterns", resolve(id)),
contents: escapeHtml(await sander.readFile(file))
});
}