From 20da08ecbb3061522ef6b7ac0eb0455030f0eaf2 Mon Sep 17 00:00:00 2001 From: Kazuhiro MUSASHI Date: Sat, 13 Apr 2019 19:01:46 +0800 Subject: [PATCH] Delete the `public` directory before generating the contents. ``` --- a/tasks/build.rake +++ b/tasks/build.rake @@ -20,8 +20,6 @@ end desc 'Generate the HTML pages' task :build do - sh 'hugo' - cd 'content/post' do if os == :linux sh 'grep -l ecx.images-amazon.com *.md | sort | uniq | xargs --no-run-if-empty sed -ie "s/http:\/\/ecx.images-amazon.com/https:\/\/images-na.ssl-images-amazon.com/g"' @@ -33,4 +31,10 @@ task :build do sh 'rm *.mde || true' sh 'rm *.md-e || true' end + + cd 'public' do + sh 'rm -rf *' + end + + sh 'hugo' end ``` --- tasks/build.rake | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tasks/build.rake b/tasks/build.rake index ca176ad..481e3b1 100644 --- a/tasks/build.rake +++ b/tasks/build.rake @@ -20,8 +20,6 @@ end desc 'Generate the HTML pages' task :build do - sh 'hugo' - cd 'content/post' do if os == :linux sh 'grep -l ecx.images-amazon.com *.md | sort | uniq | xargs --no-run-if-empty sed -ie "s/http:\/\/ecx.images-amazon.com/https:\/\/images-na.ssl-images-amazon.com/g"' @@ -33,4 +31,10 @@ task :build do sh 'rm *.mde || true' sh 'rm *.md-e || true' end + + cd 'public' do + sh 'rm -rf *' + end + + sh 'hugo' end