Skip to content

Commit

Permalink
Adds the clean [count] parameter that sprockets, webpacker and capist…
Browse files Browse the repository at this point in the history
…rano used (#165)
  • Loading branch information
codergeek121 authored Nov 12, 2023
1 parent bc433b8 commit 0237135
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/propshaft/processor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ def clobber
FileUtils.rm_r(output_path) if File.exist?(output_path)
end

def clean
Propshaft::OutputPath.new(output_path, load_path.manifest).clean(2, 1.hour)
def clean(count)
Propshaft::OutputPath.new(output_path, load_path.manifest).clean(count, 1.hour)
end

private
Expand Down
5 changes: 3 additions & 2 deletions lib/propshaft/railties/assets.rake
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@ namespace :assets do
end

desc "Removes old files in config.assets.output_path"
task clean: :environment do
Rails.application.assets.processor.clean
task :clean, [:count] => [:environment] do |_, args|
count = args.fetch(:count, 2)
Rails.application.assets.processor.clean(count.to_i)
end

desc "Print all the assets available in config.assets.paths"
Expand Down

0 comments on commit 0237135

Please sign in to comment.