From 1b4c2e1a897aede673516aca2bb2943839599d3f Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Thu, 16 Nov 2023 10:48:20 +0800 Subject: [PATCH] Add clean task for Rake --- Rakefile | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Rakefile b/Rakefile index 3f1a956..a0904ea 100644 --- a/Rakefile +++ b/Rakefile @@ -89,3 +89,19 @@ desc 'Update the Hugo modules for this project' task :update do sh 'hugo mod get ./... && hugo mod tidy' end + +desc 'Clean the environment' +task :clean do + # Remove the generated files. + generated_files_dir = [ + './public', + './static/icons', + './static/posts', + ] + + generated_files_dir.each do |dir| + if File.exist? dir then + FileUtils.rm_r dir, secure: true + end + end +end