Skip to content

Clean-up temp folders on failure #3

@Maxim-Mazurok

Description

@Maxim-Mazurok

Related to #2
We could do try/catch and clean in catch, but it's quite handy to have these folders after failure because I can open them and see what went wrong, experiment, etc. Perhaps, do a cleanup at the start? But then TempFolderManager is kinda redundant... we can preserve all temp folders that we've created into some log file and then use this log at the startup to make sure we delete all folders created before.
A much simpler solution would be to delete all dev-bench_* and npm_cache_* folders.
Perhaps we could re-purpose TempFolderManager to register friendly names so that we know which patterns to clean. This will have to be done at the "DI" stage.
We'll have to refactor nodeenv to be a class, and then pass the TempFolderManager instance to nodeenv's constructor, which will register its temp folder friendly name there: "npm_cache".

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions