Skip to content

Commit f613120

Browse files
committed
fix(arr): add force option to install method to skip installation if binary exists
1 parent 647c3d5 commit f613120

2 files changed

Lines changed: 14 additions & 2 deletions

File tree

utils/arr.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,11 +203,23 @@ def fetch_release_by_tag(tag):
203203

204204
return None, f"No matching Linux {arch_key} tarball found on GitHub."
205205

206-
def install(self):
206+
def install(self, force=False):
207207
try:
208208
logger.info(f"Installing {self.app_name_cap}...")
209209

210210
os.makedirs(self.install_dir, exist_ok=True)
211+
binary_path = os.path.join(
212+
self.install_dir, self.app_name_cap, self.app_name_cap
213+
)
214+
if not force and os.path.exists(binary_path):
215+
if not os.access(binary_path, os.X_OK):
216+
os.chmod(binary_path, 0o755)
217+
logger.info(
218+
"%s binary already present at %s; skipping install.",
219+
self.app_name_cap,
220+
binary_path,
221+
)
222+
return True, None
211223

212224
def download_with_wget(download_url):
213225
before_files = set(os.listdir(self.install_dir))

utils/auto_update.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@ def update_check_arr_latest(self, process_name, config, key, instance_name):
404404
if process_name in self.process_handler.setup_tracker:
405405
self.process_handler.setup_tracker.remove(process_name)
406406

407-
success, error = installer.install()
407+
success, error = installer.install(force=True)
408408
if not success:
409409
return (
410410
False,

0 commit comments

Comments
 (0)