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

Will this ever overwrite a user's directory accidentally? #145

Open
ehmatthes opened this issue May 29, 2017 · 0 comments
Open

Will this ever overwrite a user's directory accidentally? #145

ehmatthes opened this issue May 29, 2017 · 0 comments

Comments

@ehmatthes
Copy link
Owner

ehmatthes commented May 29, 2017

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:

print("\nDeleting current html_site directory...")
try:
    rmtree('html_site')
    print("  Deleted html_site.")
except FileNotFoundError:
    print("  No html_site directory found.")
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

No branches or pull requests

1 participant