Rakefile: add "nanoc:clean" task

This commit is contained in:
0x1eef 2022-11-08 07:45:40 -03:00
parent 172f25bd62
commit 7c58d7c82e

View file

@ -1,6 +1,7 @@
# frozen_string_literal: true
require "bundler/setup"
require "ryo"
require_relative "lib/tasks"
include Tasks
@ -8,6 +9,11 @@ namespace :nanoc do
task :compile do
sh "nanoc co"
end
task :clean do
build_dir = Ryo.from(YAML.load_file("./nanoc.yaml")).output_dir
sh "rm -rf #{build_dir}"
end
end
task build: "nanoc:compile"
@ -22,7 +28,7 @@ namespace :deploy do
Deploy::Local.call
end
task remote: ["nanoc:compile"] do
task remote: ["nanoc:clean", "nanoc:compile"] do
require "dotenv"
Dotenv.load
Deploy::Remote.call