Skip to content

Fix directory handling optimizer#214

Open
DBodesheim wants to merge 2 commits into
JelfsMaterialsGroup:masterfrom
DBodesheim:fix_directory_handling_optimizer
Open

Fix directory handling optimizer#214
DBodesheim wants to merge 2 commits into
JelfsMaterialsGroup:masterfrom
DBodesheim:fix_directory_handling_optimizer

Conversation

@DBodesheim

Copy link
Copy Markdown
Contributor

Related to #213

A FileIOOptimizer class was added, which acts as a parent class to Optimizers that need to create an output directory.

The FileIOOptimizer contains the following functionality:

  • Remove the output_dir if it already exists and then create it again (same as previous behavior).
  • If the output_dir is the the current working directory, a ValueError is being raised to prevent accidental deletion.
  • An option delete_path was added, which raises a FileExistsError if output_dir already exists and if delete_path=False. The default behavior is delete_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 FileIOOptimizer is used. If the changes so far will be approved, I will also implement the FileIOOptimizer to all other relevant Optimizer classes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant