chore: format script code.
This commit is contained in:
@ -3,17 +3,18 @@ import chokidar from 'chokidar';
|
||||
import { getStat } from 'recursive-readdir-files';
|
||||
import { run, DOCS, createHTML } from './index.mjs';
|
||||
|
||||
;(async () => {
|
||||
(async () => {
|
||||
await run();
|
||||
const homeMdPath = path.relative(process.cwd(), 'README.md')
|
||||
const homeMdPath = path.relative(process.cwd(), 'README.md');
|
||||
const watcher = chokidar.watch([DOCS, homeMdPath], {
|
||||
ignored: /(^|[\/\\])\../, // ignore dotfiles
|
||||
persistent: true
|
||||
persistent: true,
|
||||
});
|
||||
|
||||
watcher.on('change', async (path) => {
|
||||
const stats = await getStat(path)
|
||||
createHTML([stats]);
|
||||
})
|
||||
.on('error', error => console.log(`Watcher error: ${error}`))
|
||||
})();
|
||||
watcher
|
||||
.on('change', async (path) => {
|
||||
const stats = await getStat(path);
|
||||
createHTML([stats]);
|
||||
})
|
||||
.on('error', (error) => console.log(`Watcher error: ${error}`));
|
||||
})();
|
||||
|
Reference in New Issue
Block a user