Skip to content

Commit

Permalink
improved logic for package manager
Browse files Browse the repository at this point in the history
  • Loading branch information
Lorenzo Bracciale committed Sep 9, 2022
1 parent 350da3d commit 0490db0
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions package_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,8 @@ def pull(self, package_name):
Download a package in the appropriate directory.
Return True if downloaded, false if already exists, and throw exception in case of errors.
"""
# if there is not a folder, download the package
if package_name == 'hike_default':
raise Exception("Attempt to fetch the hike_default package. This is a system package which is already installed.")

if os.path.isdir(f"{settings.COMPONENTS_DIR}/{package_name}"):
logger.info(f"Attempting to download package '{package_name}' which is already downloaded")
# if is a system package or if the package has been already downloaded, do nothing.
if package_name == 'hike_default' or os.path.isdir(f"{settings.COMPONENTS_DIR}/{package_name}"):
return False


Expand Down

0 comments on commit 0490db0

Please sign in to comment.