From 50bb68ddc820bfbece26178553a3a214061ab17d Mon Sep 17 00:00:00 2001 From: Henrique Dias Date: Tue, 25 Jul 2017 16:15:28 +0100 Subject: [PATCH] Fix bug when there is no rice-box --- assets/build/dev.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/assets/build/dev.js b/assets/build/dev.js index 35f785a3..b3f30bb6 100644 --- a/assets/build/dev.js +++ b/assets/build/dev.js @@ -10,8 +10,13 @@ var config = require('./config') var webpackConfig = require('./webpack.dev.conf') var fs = require('fs') -fs.unlinkSync('./rice-box.go') -fs.unlinkSync('./caddy/hugo/rice-box.go') +if (fs.existsSync('./rice-box.go')) { + fs.unlinkSync('./rice-box.go') +} + +if (fs.existsSync('./caddy/hugo/rice-box.go')) { + fs.unlinkSync('./caddy/hugo/rice-box.go') +} rm(path.join(config.assetsRoot, config.assetsSubDirectory), err => { if (err) throw err