Add dialogue to rule purge to prevent accidents (#745)
This commit is contained in:
parent
445892dd87
commit
834f7ea144
17
Snakefile
17
Snakefile
@ -73,12 +73,19 @@ rule all:
|
||||
|
||||
|
||||
rule purge:
|
||||
message:
|
||||
"Purging generated resources, results and docs. Downloads are kept."
|
||||
run:
|
||||
rmtree("resources/", ignore_errors=True)
|
||||
rmtree("results/", ignore_errors=True)
|
||||
rmtree("doc/_build", ignore_errors=True)
|
||||
import builtins
|
||||
|
||||
do_purge = builtins.input(
|
||||
"Do you really want to delete all generated resources, \nresults and docs (downloads are kept)? [y/N] "
|
||||
)
|
||||
if do_purge == "y":
|
||||
rmtree("resources/", ignore_errors=True)
|
||||
rmtree("results/", ignore_errors=True)
|
||||
rmtree("doc/_build", ignore_errors=True)
|
||||
print("Purging generated resources, results and docs. Downloads are kept.")
|
||||
else:
|
||||
raise Exception(f"Input {do_purge}. Aborting purge.")
|
||||
|
||||
|
||||
rule dag:
|
||||
|
@ -20,6 +20,7 @@ Upcoming Release
|
||||
|
||||
* Files extracted from sector-coupled data bundle have been moved from ``data/`` to ``data/sector-bundle``.
|
||||
|
||||
* Rule ``purge`` now initiates a dialog to confirm if purge is desired.
|
||||
|
||||
**Bugs and Compatibility**
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user