Skip to content

Commit

Permalink
Fix file copy with glob
Browse files Browse the repository at this point in the history
  • Loading branch information
jorg-vr committed Oct 26, 2023
1 parent f010b2a commit 21f0a5d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion config/initializers/assets.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# folder are already added.
# Rails.application.config.assets.precompile += %w( admin.js admin.css )

Rails.application.config.assets.nodigest = ['*.nodigest.js']
Rails.application.config.assets.nodigest = ['*.nodigest.js', '*.load_by_url']
8 changes: 5 additions & 3 deletions lib/tasks/assets.rake
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ namespace :assets do
task nodigest: :environment do
assets_path = File.join(Rails.root, 'public', Rails.configuration.assets.prefix)
Rails.configuration.assets.nodigest.each do |asset|
source = File.join('app/assets/builds', asset)
dest = File.join(assets_path, asset)
FileUtils.copy_file(source, dest)
Dir.glob(File.join('app/assets/builds', asset)).each do |source_path|
file_name = File.basename(source_path)
dest_path = File.join(assets_path, file_name)
FileUtils.copy_file(source_path, dest_path)
end
end
end
end

0 comments on commit 21f0a5d

Please sign in to comment.