Created
June 6, 2017 13:47
-
-
Save rilian/16b436bdba34b6fa4539afe39e719967 to your computer and use it in GitHub Desktop.
copy-non-digest-assets.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
task non_digested: :environment do | |
assets = Dir.glob(File.join(Rails.root, 'public/assets/**/*')) | |
regex = /(-{1}[a-z0-9]{32}*\.{1}){1}/ | |
assets.each do |file| | |
next if File.directory?(file) || file !~ regex | |
source = file.split('/') | |
source.push(source.pop.gsub(regex, '.')) | |
non_digested = File.join(source) | |
FileUtils.cp(file, non_digested) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment