-
-
Notifications
You must be signed in to change notification settings - Fork 631
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Should use the most recent file when multiple sprockets manifest files are found #1023
Comments
I can't really remember the details of why we use a glob instead of an exact file path in the first place, like what is the use case for having manifest files with varying names? |
I think part of the name of the manifest file is a hash code, and it's hard to know that hash. Anyways it's just one line, the code I wrote above works and takes the most recent manifest file, which is always a better guess than the first in the glob list |
I could make it a PR if you prefer. Just let me know |
@ynonp Yes, please make a PR and make sure some test fails without and the same test passes with your change. And add an entry to the CHANGELOG.md. |
@ynonp Any word on making a PR? |
@samnang, @mapreal19 agree this seems to make sense? manifest_path = manifest_glob.sort_by { |name| File.mtime(name) }.last |
@justin808 yeah, we should just extract the method for hinting the intent by @ynonp. Something like |
When creating symlinks, use the most recent manifest found. See #1023
When creating symlinks, use the most recent manifest found. See #1023
Fixed in #1064 |
When creating symlinks, use the most recent manifest found. See #1023
When creating symlinks, use the most recent manifest found. See #1023
When creating symlinks, use the most recent manifest found. See #1023
When creating symlinks, use the most recent manifest found. See shakacode/react_on_rails#1023
When creating symlinks, use the most recent manifest found. See shakacode/react_on_rails#1023
A specific setup I had combining ReactOnRails with capistrano-rails had temporarily put multiple sprockets manifest files in
public/assets
when assets:precompile task was called.This failed in file
lib/react_on_rails/assets_precompile.rb
line 75:A better approach would be to take the most recent one with:
(Or raise an exception explaining the problem when multiple sprockets manifest files are found)
The text was updated successfully, but these errors were encountered: