ehmatthes / ehmatthes/intro_programming

Will this ever overwrite a user's directory accidentally?

Open
#145 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Jupyter Notebook
Stars
400
Forks
191
PR merge metrics
No merged PRs in 30d

Description

Right now build_html.py is going to delete the folder html_site, and rebuild it. Is this done safely?

I'm wondering if the script might ever be run from a context where the cwd is not the project root. It will look for a folder called html_site, and delete it and rebuild it. That would be terrible if the user had a different directory of that name, and lost it by running this script.

Would it be better to build an absolute path to this project's html_site, and use that path? Maybe get the absolute path to build_html.py, and use that to build the absolute path to html_site? Here are the relevant lines from build_html.py:

```python
print("\nDeleting current html_site directory...")
try:
rmtree('html_site')
print(" Deleted html_site.")
except FileNotFoundError:
print(" No html_site directory found.")
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.