Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fix for file not found issues

  • Loading branch information...
commit b78eb790d5025d1b54f641e2bdcd6df6b0a3b229 1 parent 8809041
@gnovos gnovos authored
Showing with 4 additions and 3 deletions.
  1. +1 −0  .gitignore
  2. +3 −3 lib/sprockets/static_non_digest_generator.rb
View
1  .gitignore
@@ -5,3 +5,4 @@ tmp
.rbenv-version
.rvmrc
*.gem
+.idea/
View
6 lib/sprockets/static_non_digest_generator.rb
@@ -36,10 +36,10 @@ def generate
abs_digest_path = "#{@target}/#{digest_path}"
abs_logical_path = "#{@target}/#{logical_path}"
- mtime = File.mtime(abs_digest_path)
-
# Remove known digests from css & js
if abs_digest_path.match(/\.(?:js|css)$/)
+ mtime = File.mtime(abs_digest_path)
+
asset_body = File.read(abs_digest_path)
# Find all hashes in the asset body with a leading '-'
@@ -68,7 +68,7 @@ def generate
else
# Otherwise, treat file as binary and copy it.
# Ignore paths that have no digests, such as READMEs
- unless abs_digest_path == abs_logical_path
+ unless !File.exist?(abs_digest_path) || abs_digest_path == abs_logical_path
FileUtils.cp_r abs_digest_path, abs_logical_path, :remove_destination => true
env.logger.debug "Copied binary asset to #{logical_path}"
Please sign in to comment.
Something went wrong with that request. Please try again.