[Rivet] rivet-mkhtml recursively removes ${pwd}/plots without warning

David Bjergaard david.bjergaard at gmail.com
Thu Oct 8 11:48:03 BST 2015


Hi All,

Luckily I didn't lose any plots that I was attached to, but I did have a ./plots
folder that was using to store intermediate results.  Removing any files without
warning the user is kind of scary which is what I think this line does:
    > if os.path.exists(opts.OUTPUTDIR) and not os.path.realpath(opts.OUTPUTDIR)==os.getcwd():
    >     import shutil
    >     shutil.rmtree(opts.OUTPUTDIR)
Why can't you throw an exception and say "OUTPUTDIR not empty, please use -f to
force overwriting", or less ideal but still better "OUTPUTDIR is not empty,
removing" so that its less of a surprise when all the subdirectories in
OUTPUTDIR have mysteriously vanished.

    David


More information about the Rivet mailing list