Skip to content
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

Adding logic to remove temporary files after CV has been generated #4

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

pgoslatara
Copy link
Collaborator

At the moment the generate_cv.py script initially removes non-.gitkeep files from the clean_pages and clean_images directories. At the end of this script these files remain in the filesystem. This is kinda messy, especially if we scale out in future by generating multiple CVs at a time.

This PR moves the cleanup_files function to the end of the script so the filesystem is not polluted after successful runs. The pathlib library is used to create the cv_pages directory at the start of the script, this does not fail if the directory already exists so an unsuccessful run which leaves a cv_pages directory will not block future runs.

Both pathlib and shutil are internal libraries so they will be available on all python runtimes.

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