♻️ Chore

This commit is contained in:
Nikhil Badyal
2023-07-12 15:45:35 +05:30
parent 22be230567
commit 00f83ad969
4 changed files with 14 additions and 13 deletions
+6 -1
View File
@@ -109,6 +109,11 @@ class Downloader(object):
:param file_name: name of the file after downloading
"""
logger.debug(f"Trying to download {name} from github")
if self.config.dry_run:
logger.debug(
f"Skipping download of {file_name}. File already exists or dry running."
)
return
repo_url = f"https://api.github.com/repos/{owner}/{name}/releases/latest"
headers = {
"Content-Type": "application/vnd.github.v3+json",
@@ -129,7 +134,7 @@ class Downloader(object):
def download_revanced(self) -> None:
"""Download Revanced and Extended Patches, Integration and CLI."""
if os.path.exists("changelog.md"):
if os.path.exists("changelog.md") and not self.config.dry_run:
logger.debug("Deleting old changelog.md")
os.remove("changelog.md")
assets = [
-1
View File
@@ -35,7 +35,6 @@ class UptoDown(Downloader):
extracted_version = version_item.find("span", {"class": "version"}).text
if extracted_version == version:
download_url = version_item["data-url"]
print(f"data-url for version {version}: {download_url}")
break
if download_url is None:
raise AppNotFound(f"Unable to get download url for {app}")