Prevent overwriting the manifest in the first phase of the build#63
Open
jagthedrummer wants to merge 6 commits intoplasticine:masterfrom
Open
Prevent overwriting the manifest in the first phase of the build#63jagthedrummer wants to merge 6 commits intoplasticine:masterfrom
jagthedrummer wants to merge 6 commits intoplasticine:masterfrom
Conversation
KevinBongart
left a comment
There was a problem hiding this comment.
Thanks for looking into this! I authored à related bug fix but looks like yours is a better soltion
| def manifest_content | ||
| if @source_file.nil? | ||
| path = File.join(@app.config[:build_dir], @destination_path) | ||
| if !File.exist?(path) |
There was a problem hiding this comment.
Nitpick but this would be generally easier to understand using the positive form:
if File.exists?(path)
do B
else
do A
end
Instead of if !x do A else do B
|
Any news on merging this? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Since we store the optimization manifest in the
builddirectory, and since it doesn't have a counterpart in thesourcedirectory theManifestResourceneeds to behave a little differently than your average resource. Instead of reading a file fromsourceand writing it tobuildwe want to read frombuildif the file already exists, so that we preserve the contents of that file through the first stage of the build.In one of my projects this PR takes a 22 minute build down to 2 minutes.
Fixes #60
Fixes #41, Closes #58 (Specifying the manifest path shouldn't be needed if we don't overwrite it, and storing it outside the build directory doesn't exactly make sense since it is an artifact of a particular build, or sequence of builds. To say it another way, if you used an existing manifest with an empty build directory you'd end up skipping optimization of images that would need to be optimized.)