From 583dfc27988341bd8db30844d01028ac788bed4a Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Thu, 25 Sep 2014 14:54:53 -0400 Subject: [PATCH 1/1] Provide cleanup switch to quickrun Easier to wipe old test and start with fresh data for a quickrun Signed-off-by: Simo Sorce Reviewed-by: Patrick Uiterwijk --- quickrun.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/quickrun.py b/quickrun.py index 8eb64a6..60b3899 100755 --- a/quickrun.py +++ b/quickrun.py @@ -19,6 +19,7 @@ import argparse import os +import shutil import subprocess from string import Template @@ -31,6 +32,8 @@ def parse_args(): 'Run a test Ipsilon instance from the checkout directory') parser.add_argument('--workdir', default=os.path.join(os.getcwd(), 'qrun'), help="Directory in which db/session files are stored") + parser.add_argument('--cleanup', '-c', action='store_true', default=False, + help="Wipe workdir before starting") return vars(parser.parse_args()) @@ -83,6 +86,10 @@ if __name__ == '__main__': penv.update(os.environ) penv['PYTHONPATH'] = './' + + if args['cleanup']: + shutil.rmtree(args['workdir']) + if not os.path.exists(args['workdir']): conf = config(args['workdir']) else: -- 2.20.1