Skip to content

Commit

Permalink
Add task to reveal the full path of assets
Browse files Browse the repository at this point in the history
  • Loading branch information
brenogazzola committed Dec 4, 2021
1 parent 4b072f7 commit 45ec988
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/propshaft/assembly.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,18 @@ def compilers
end
end

def reveal
def reveal(type = :logical)
load_path.assets.each do |asset|
Propshaft.logger.info asset.logical_path
Propshaft.logger.info path_to_reveal(asset, type)
end
end

private
def manifest_path
config.output_path.join(Propshaft::Processor::MANIFEST_FILENAME)
end

def path_to_reveal(asset, type)
type == :full ? asset.path : asset.logical_path
end
end
7 changes: 7 additions & 0 deletions lib/propshaft/railties/assets.rake
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,11 @@ namespace :assets do
task reveal: :environment do
Rails.application.assets.reveal
end

namespace :reveal do
desc "Print the full path of assets available in config.assets.paths"
task full: :environment do
Rails.application.assets.reveal(:full)
end
end
end

0 comments on commit 45ec988

Please sign in to comment.