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

fix how CL works

parent 940fb616
No related branches found
No related tags found
No related merge requests found
......@@ -11,18 +11,18 @@ __doc__ = """Integrated Metaomic Pipeline.
(____)(_/\/\_)(__)
Usage:
IMP init <data> <output> [--name=<n>]
IMP init <data> <output> [<name>]
IMP run [VAR ...]
IMP -h | --help
IMP --version
Options:
-h --help Show this help and exit
--name=<n> Name of the configuration file [default: IMP].
Parameters:
data: the path where your data is stored
output: the path where IMP will write result files
name: the name of the configuration file [default:IMP]
MG an MT : the path to your data files
"""
......@@ -98,6 +98,7 @@ def get_version():
if __name__ == '__main__':
args = docopt(__doc__, version=get_version(), options_first=True)
# get config file from cache
config_files = get_config_cache().split()
# delete if some config files are removed
......@@ -112,11 +113,13 @@ if __name__ == '__main__':
if args['init']:
data = Path(args['<data>']).abspath()
output = Path(args['<output>']).abspath()
name = args['--name']
name = args['<name>']
if name is None:
name = 'IMP'
docker_compose_path = Path(output / '%s.yml' % name)
env_file = Path(output / '.env').touch()
compose = DOCKER_COMPOSE_TMPL.format(data=data, output=output, code=CURRENT_PATH, name=name)
if docker_compose_path.exists() and not yes_or_no("Configuration already exist. Overwrite ?"):
if docker_compose_path.exists() and not yes_or_no("Configuration already exist. Overwrite ''%s'?" % docker_compose_path):
print("Exiting ... ")
exit(0)
if docker_compose_path not in config_files:
......
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