Skip to content

Commit 189bbc3

Browse files
authored
Merge pull request #231 from fosslight/link
Prevent entering path instead of link
2 parents 2c723c5 + b99a394 commit 189bbc3

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
@@ -119,6 +119,9 @@ def cli_download_and_extract(link: str, target_dir: str, log_dir: str, checkout_
119119
elif os.path.isfile(target_dir):
120120
success = False
121121
msg = f"The target directory exists as a file.: {target_dir}"
122+
elif os.path.exists(link) or os.path.isdir(link) or os.path.isfile(link):
123+
success = False
124+
msg = f"You cannot enter a path instead of a link.: {link}"
122125
else:
123126
src_info = parse_src_link(link)
124127
link = src_info.get("url", "")

0 commit comments

Comments
 (0)