def find_project_dir(project):
if project is None:
project = "."
root = get_project_root()
if root is None:
root = Path()
project_dir = Path(project)
if "." == project:
project_dir = Path(".")
elif "/" not in project and "\\" not in project:
if "projects" in config:
if project in config["projects"]:
project_dir = Path(config["projects"].get(project))
project_dir = root.joinpath(project_dir.expanduser())
else:
project_dir = project_dir.expanduser()
if not project_dir.exists():
project_dir = root.joinpath(project_dir)
if project_dir.is_dir():
project_dir = project_dir.resolve()
return project_dir
评论列表
文章目录