Allow relative project path

This commit is contained in:
Sybren A. Stüvel 2018-03-14 14:36:40 +01:00
parent 9ceb42af2f
commit 73b264f6bc

View File

@ -97,11 +97,13 @@ def paths_from_cli(args) -> typing.Tuple[pathlib.Path, pathlib.Path, pathlib.Pat
ppath = bpath.absolute().parent ppath = bpath.absolute().parent
log.warning('No project path given, using %s', ppath) log.warning('No project path given, using %s', ppath)
else: else:
ppath = args.project.absolute() ppath = args.project
if not ppath.exists(): if not ppath.exists():
log.critical('Project directory %s does not exist', ppath) log.critical('Project directory %s does not exist', ppath)
sys.exit(5) sys.exit(5)
ppath = ppath.absolute().resolve()
if not ppath.is_dir(): if not ppath.is_dir():
log.warning('Project path %s is not a directory; using the parent %s', ppath, ppath.parent) log.warning('Project path %s is not a directory; using the parent %s', ppath, ppath.parent)
ppath = ppath.parent ppath = ppath.parent