Skip to content
Snippets Groups Projects
Commit 1a76fca8 authored by Yohan Jarosz's avatar Yohan Jarosz
Browse files

add --ask param

parent a8ec898c
No related branches found
No related tags found
No related merge requests found
......@@ -16,7 +16,7 @@ __doc__ = """Integrated Metaomic Pipeline.
(____)(_/\/\_)(__)
Usage:
IMP [-m MG1 -m MG2] [-t MT1 -t MT2] -o OUTPUT [--enter] [--norm] [-n CONTAINER] [-d DBPATH] [-e ENV] ... [COMMANDS ...]
IMP [-m MG1 -m MG2] [-t MT1 -t MT2] -o OUTPUT [--enter] [--norm] [--ask] [-n CONTAINER] [-d DBPATH] [-e ENV] ... [COMMANDS ...]
IMP --init [-d DBPATH]
IMP (-h | --help)
IMP --version
......@@ -26,6 +26,7 @@ Options:
--enter Enter the container
--init Initialize IMP databases (Take a while)
--norm Don't delete the container after use. Useful for debugging.
--ask Ask to create directory if it desn't exist.
-h --help Show this help and exit
-m MG Path to the metagenomics paired files (must be 2 files).
-t MT Path to the metatranscriptomic paired files (2 files).
......@@ -97,10 +98,9 @@ def run(args):
output = Path(args['-o']).abspath()
if not output.exists():
if yes_or_no("Output '%s' doesn't exist. Create ?" % output):
output.makedirs()
else:
if args['--ask'] and not yes_or_no("Output '%s' doesn't exist. Create ?" % output):
exit(0)
output.makedirs()
container_name = args['-n'] is not None and args['-n'] or 'imp:latest'
db_path = Path(args['-d']).abspath()
# configure IMP mount point to the docker container
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment