Check if file exists

This commit is contained in:
Piotr Sarnacki 2015-01-16 12:01:21 +01:00
parent a0a7056f1d
commit 06795152aa

View File

@ -6,6 +6,7 @@ require 'fileutils'
def fingerprint(file_path)
# file_path is relative to public
public_file_path = "public/#{file_path}"
return unless File.exists?(public_file_path)
digest = Digest::MD5.file public_file_path
extension = File.extname(file_path)
basename = File.basename(file_path, extension)