Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds the assets:clean[count] parameter #165

Merged
merged 1 commit into from
Nov 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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