lib/vite_ruby/commands.rb in vite_ruby-1.1.2 vs lib/vite_ruby/commands.rb in vite_ruby-1.2.0
- old
+ new
@@ -21,12 +21,12 @@
builder.build(*args).tap { manifest.refresh }
end
# Public: Removes all build cache and previously compiled assets.
def clobber
- config.build_output_dir.rmtree if config.build_output_dir.exist?
- config.build_cache_dir.rmtree if config.build_cache_dir.exist?
- config.vite_cache_dir.rmtree if config.vite_cache_dir.exist?
+ dirs = [config.build_output_dir, config.build_cache_dir, config.vite_cache_dir]
+ dirs.each { |dir| dir.rmtree if dir.exist? }
+ $stdout.puts "Removed vite cache and output dirs:\n\t#{ dirs.join("\n\t") }"
end
# Public: Receives arguments from a rake task.
def clean_from_task(args)
ensure_log_goes_to_stdout {