diff --git a/render.js b/render.js index 72f0e1f..d10f5b1 100644 --- a/render.js +++ b/render.js @@ -206,6 +206,7 @@ const do_pug = (prt, root) => async tree => { } const rm_tree = t => { + if (t == null) return if (t.type == 'file') { log('[do_clean] file', t.path) return fs.unlink(t.path) @@ -219,7 +220,11 @@ const rm_tree = t => { }) } -const do_clean = path => tree => walk(path).then(rm_tree).then(_ => tree) +const do_clean = path => tree => + walk(path) + .catch(_ => null) + .then(rm_tree) + .then(_ => tree) const conf = { src: './src', dest: './static'} walk(conf.src)