Skip to content
Browse files

Merge pull request #71 from gnovos/master

fix for file not found issues
  • Loading branch information...
2 parents 8809041 + b78eb79 commit 4236d571dee06ed687ef48facd438555e1b01e46 @ndbroadbent committed
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}"

0 comments on commit 4236d57

Please sign in to comment.
Something went wrong with that request. Please try again.