Skip to content

Commit b99a394

Browse files
committed
Prevent entering path instead of link
1 parent b5942da commit b99a394

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/fosslight_util/download.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,9 @@ def cli_download_and_extract(link: str, target_dir: str, log_dir: str, checkout_
115115
elif os.path.isfile(target_dir):
116116
success = False
117117
msg = f"The target directory exists as a file.: {target_dir}"
118+
elif os.path.exists(link) or os.path.isdir(link) or os.path.isfile(link):
119+
success = False
120+
msg = f"You cannot enter a path instead of a link.: {link}"
118121
else:
119122
src_info = parse_src_link(link)
120123
link = src_info.get("url", "")

0 commit comments

Comments
 (0)