Issue #15 resolved

Be reluctant to delete everything in destination

Sergey Astanin
created an issue

Current obraz.py silently purges the entire destination directory, which is wrong as a misunderstood usage message or a typo may result in unlimited damage to the system.

The help message should make clear that:

  • --destination is supposed to be the root of the site itself
  • what is the default destination
  • obraz.py is about to purge everything in this directory (ALLCAPS please)

    -d --destination=DIR   Destination directory (default: ./_site) -- WILL BE PURGED!
    

The program should not act as a silent alias to rm -rf, and instead

  • may try to identify an existing site directory (by dropping there a special .dotfile, or checking if index.html and year-like subdirectories are present); if the destination doesn't appear to be a site directory, ask for confirmation
  • may always ask for confirmation if non-default destination is used, and implement --purge-destination option for the bravest

Comments (7)

  1. Sergey Astanin reporter

    Well, fortunately, I don't use Jekyll. Unfortunately, this issue caused me to wipe the entire site source with new unpushed changes once. So I still believe that it's relevant.

    I'll prepare a pull request.

  2. Log in to comment