Created
August 16, 2016 14:42
-
-
Save gotbadger/4b7945aab5f6964e80ae6ce02ef4ecb3 to your computer and use it in GitHub Desktop.
Somtimes you need to diff the output of rake assets:precompile run this script after to remove fingerprints
This file contains 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.mv(file, non_digested) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment