From 454f19a0f7cb492b02029c0b7fec5ac2fe20063e Mon Sep 17 00:00:00 2001 From: Andy Date: Fri, 25 Jul 2025 18:09:06 +0000 Subject: [PATCH] =?UTF-8?q?fix(env):=20=F0=9F=90=9B=20Update=20binary=20se?= =?UTF-8?q?arch=20functionality=20to=20use=20`binaries.find`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Refactored the `find_binary` function to utilize `binaries.find` for improved binary detection. * Updated dependency path retrieval to ensure accurate results. --- unshackle/commands/env.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/unshackle/commands/env.py b/unshackle/commands/env.py index 720b5db..57eaab2 100644 --- a/unshackle/commands/env.py +++ b/unshackle/commands/env.py @@ -10,6 +10,7 @@ from rich.padding import Padding from rich.table import Table from rich.tree import Tree +from unshackle.core import binaries from unshackle.core.config import POSSIBLE_CONFIG_PATHS, config, config_path from unshackle.core.console import console from unshackle.core.constants import context_settings @@ -36,7 +37,7 @@ def check() -> None: # Helper function to find binary with multiple possible names def find_binary(*names): for name in names: - if shutil.which(name): + if binaries.find(name): return name return names[0] # Return first name as fallback for display @@ -50,11 +51,11 @@ def check() -> None: ] for dep in dependencies: - path = shutil.which(dep["binary"]) + path = binaries.find(dep["binary"]) if path: installed = "[green]:heavy_check_mark:[/green]" - path_output = path.lower() + path_output = str(path) else: installed = "[red]:x:[/red]" path_output = "Not Found"