DocOps / liquidoc-gem

The canonical gem source for LiquiDoc, a ruby-based documentation parsing and rendering utility enabling advanced builds with Asciidoctor, Jekyll, Liquid, and semi-structured data files.
https://docs.docops.org/liquidoc-user-manual.html
MIT License
12 stars 5 forks source link

Enable "clean" action, and do it right (safely) #35

Open briandominick opened 6 years ago

briandominick commented 6 years ago

Since it's possible to muck up one's build through disorderly preprocessing, yet since preprocessor files saved to the build directory can be safely cleared, it stands to reason that we should offer users the ability to erase their build dir prior to a new build. This is a standard option in build tools, though in our case it needn't do more than delete a build directory.

It should be invokable from the configuration itself, as well as from the CLI. Keep in mind there is no standard "build" directory, so it needs to be explicit.

Usage:

bundle exec liquidoc -c config.yml --clean _build

For now, this is accomplished manually with:

rm -rf _build; bundle exec liquidoc -c config.yml

Consider a safety requiring a flag such as --unsafe to allow operations below the pwd (probably Ruby prevents this by default?) and to delete certain subdirectories like content, src, source, _templates, etc, etc, etc, or maybe anything that doesn't have the word build in the path...?