Skip to content

Commit 1bf949c

Browse files
authored
Fix the url type to null when not matched (#224)
Signed-off-by: 석지영/책임연구원/SW공학(연)Open Source TP <[email protected]>
1 parent e4c80ab commit 1bf949c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/fosslight_util/_get_downloadable_url.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
def extract_name_version_from_link(link):
1717
oss_name = ""
1818
oss_version = ""
19+
matched = False
1920
if link.startswith("www."):
2021
link = link.replace("www.", "https://www.", 1)
2122
for key, value in constant.PKG_PATTERN.items():
@@ -55,7 +56,10 @@ def extract_name_version_from_link(link):
5556
if key in ["pypi", "maven", "npm", "npm2", "pub", "go"]:
5657
oss_version, link = get_latest_package_version(link, key, origin_name)
5758
logger.info(f'Try to download with the latest version:{link}')
59+
matched = True
5860
break
61+
if not matched:
62+
key = ""
5963
return oss_name, oss_version, link, key
6064

6165

0 commit comments

Comments
 (0)