aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQuentin Dufour <quentin@deuxfleurs.fr>2020-05-08 09:24:41 +0200
committerQuentin Dufour <quentin@deuxfleurs.fr>2020-05-08 09:24:41 +0200
commit2e528b86adad5e2c930ce635e628c0bdc8e7fb20 (patch)
treef65e5ae9b434d74fc8634c16e3785c3adc427d53
parent882375c54ff272ec4b84c47f9bdf3907029ec233 (diff)
downloadsite-2e528b86adad5e2c930ce635e628c0bdc8e7fb20.tar.gz
site-2e528b86adad5e2c930ce635e628c0bdc8e7fb20.zip
Fix no static folder bug
-rw-r--r--render.js7
1 files changed, 6 insertions, 1 deletions
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)