parsing: treat locations without scheme as belonging to 'tree://'

This commit is contained in:
Nikita Dubrovskii 2024-10-28 11:20:23 +01:00 committed by Michael Vogt
parent 077244e3b9
commit 6a59e740e4
3 changed files with 42 additions and 7 deletions

View file

@ -15,12 +15,9 @@ def main(args):
parents = item.get("parents", False)
exist_ok = item.get("exist_ok", False)
if "://" not in path:
if not path.startswith("/"):
print("WARNING: relative path used, this is discouraged!")
path = f"tree:///{path}"
else:
path = f"tree://{path}"
if "://" not in path and not path.startswith("/"):
print("WARNING: relative path used, this is discouraged!")
path = f"tree:///{path}"
target = parsing.parse_location(path, args)
if parents: