Skip to content

Commit

Permalink
fixed missing url http or https
Browse files Browse the repository at this point in the history
  • Loading branch information
marwaneltoukhy committed Aug 4, 2024
1 parent 3cbf8f7 commit 153d8af
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
12 changes: 10 additions & 2 deletions ipm/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -779,8 +779,16 @@ def check_url(self, url):
bool: True if can be accessed, False if failed to access
"""

repo_response = GitHubSession().get(url)
return (repo_response.status_code // 100) == 2
logger = Logger()
if not url.startswith(('http://', 'https://')):
url = 'https://' + url

try:
repo_response = GitHubSession().get(url)
return (repo_response.status_code // 100) == 2
except Exception as e:
logger.print_err(f"Failed to access URL: {url}. Error: {str(e)}")
return False

def check_yaml(self):
"""checks the json if it has all the variables needed
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "ipmgr"
version = "1.0.9"
version = "1.0.10"
description = "Package manager for Open Source ASIC IPs"
authors = ["Efabless Corporation <[email protected]>"]
readme = "README.md"
Expand Down

0 comments on commit 153d8af

Please sign in to comment.