Skip to content

Commit

Permalink
Don' show any output when file not changed.
Browse files Browse the repository at this point in the history
  • Loading branch information
miloops committed Oct 4, 2011
1 parent e8aaa40 commit f366981
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions lib/jammit/s3_uploader.rb
Expand Up @@ -71,15 +71,15 @@ def upload_from_glob(glob)
use_gzip = true
remote_path = remote_path.gsub(/\.gz$/, "")
end

# check if the file already exists on s3
begin
obj = @bucket.objects.find_first(remote_path)
rescue
obj = nil
end

# if the object does not exist, or if the MD5 Hash / etag of the
# if the object does not exist, or if the MD5 Hash / etag of the
# file has changed, upload it
if !obj || (obj.etag != Digest::MD5.hexdigest(File.read(local_path)))

Expand All @@ -97,8 +97,6 @@ def upload_from_glob(glob)
log "File changed and will be invalidated in cloudfront: #{remote_path}"
@changed_files << remote_path
end
else
log "file has not changed: #{remote_path}"
end
end
end
Expand All @@ -118,7 +116,7 @@ def find_or_create_bucket
bucket
end
end

def invalidate_cache(files)
paths = ""
files.each do |key|
Expand Down

0 comments on commit f366981

Please sign in to comment.