Fix directory handling optimizer#214
Open
DBodesheim wants to merge 2 commits into
Open
Conversation
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.
Related to #213
A
FileIOOptimizerclass was added, which acts as a parent class to Optimizers that need to create an output directory.The
FileIOOptimizercontains the following functionality:output_dirif it already exists and then create it again (same as previous behavior).output_diris the the current working directory, aValueErroris being raised to prevent accidental deletion.delete_pathwas added, which raises aFileExistsErrorifoutput_diralready exists and ifdelete_path=False. The default behavior isdelete_path=True, i.e. same as previous behavior.Additionally, tests were added for the
FileIOOptimizer.Finally, it was shown for the gulp optimizers, how the code would change if the
FileIOOptimizeris used. If the changes so far will be approved, I will also implement theFileIOOptimizerto all other relevant Optimizer classes.