From 2d644095429e39b6b307c50a7a22fb0e0a1ee1eb Mon Sep 17 00:00:00 2001 From: I-Al-Istannen Date: Sat, 5 Dec 2020 13:50:46 +0100 Subject: [PATCH] Fix handling of empty args.folder --- sync_url.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sync_url.py b/sync_url.py index 91a7521..97c0c81 100755 --- a/sync_url.py +++ b/sync_url.py @@ -59,7 +59,6 @@ def main() -> None: cookie_jar.load_cookies() - folder = Path(args.folder) if args.folder is None: element_name = crawler.find_element_name(args.url) if not element_name: @@ -67,6 +66,8 @@ def main() -> None: return folder = Path(element_name) cookie_jar.save_cookies() + else: + folder = Path(args.folder) # files may not escape the pferd_root with relative paths # note: Path(Path.cwd, Path(folder)) == Path(folder) if it is an absolute path