Don't run java check in dry run

This commit is contained in:
Nikhil Badyal
2023-08-04 10:25:52 +05:30
parent 2c2a774ac7
commit 6210ce42db
+4 -2
View File
@@ -65,9 +65,11 @@ class Patches(object):
} }
@staticmethod @staticmethod
def check_java() -> None: def check_java(dry_run: bool) -> None:
"""Check if Java17 is installed.""" """Check if Java17 is installed."""
try: try:
if dry_run:
return
jd = subprocess.check_output( jd = subprocess.check_output(
["java", "-version"], stderr=subprocess.STDOUT ["java", "-version"], stderr=subprocess.STDOUT
).decode("utf-8") ).decode("utf-8")
@@ -152,7 +154,7 @@ class Patches(object):
def __init__(self, config: RevancedConfig) -> None: def __init__(self, config: RevancedConfig) -> None:
self.config = config self.config = config
self.check_java() self.check_java(self.config.dry_run)
self.fetch_patches() self.fetch_patches()
if self.config.dry_run: if self.config.dry_run:
self.config.apps = list(self._revanced_app_ids.values()) self.config.apps = list(self._revanced_app_ids.values())