Add clean task for Rake

This commit is contained in:
Gabriel Arazas 2023-11-16 10:48:20 +08:00
parent a751e4b337
commit 1b4c2e1a89
No known key found for this signature in database
GPG Key ID: ADE0C41DAB221FCC

View File

@ -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