-
Notifications
You must be signed in to change notification settings - Fork 384
Description
Here I only want to share how I was confused (and almost discarded the idea of using invoke) after reading the documentation and how I think it could be improved.
In https://github.com/pyinvoke/invoke/blob/master/sites/docs/getting_started.rst#declaring-pre-tasks we read:
"Let’s expand our docs builder with a new cleanup task that runs before every build (but which, of course, can still be executed on its own):"
from invoke import task, run
@task
def clean():
run("rm -rf docs/_build")
@task(clean)
def build():
run("sphinx-build docs docs/_build")
I think one should emphasize the crucial role of the force flag in rm. Without it, running invoke clean followed by invoke build doesn't work and, to me, it wasn't immediately clear why. I even made the situation worse by using hide=true in the clean task (I wasn't interested in knowing that there was nothing to remove). I think it could be a could place to mention the option warn=True as an alternative to using rm -f. This option is mentioned in the FAQ but not in getting started.