From d5bbda1e2f7d2a536b81526c371fc5484e77e66f Mon Sep 17 00:00:00 2001 From: codefiles <11915375+codefiles@users.noreply.github.com> Date: Mon, 13 Jan 2025 22:22:47 -0500 Subject: [PATCH] Refactor cmd path check using startswith() (#3117) --- archinstall/lib/general.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/archinstall/lib/general.py b/archinstall/lib/general.py index 06961551..7015192d 100644 --- a/archinstall/lib/general.py +++ b/archinstall/lib/general.py @@ -115,9 +115,8 @@ class SysCommandWorker: if isinstance(cmd, str): cmd = shlex.split(cmd) - if cmd: - if cmd[0][0] != '/' and cmd[0][:2] != './': # Path() does not work well - cmd[0] = locate_binary(cmd[0]) + if cmd and not cmd[0].startswith(('/', './')): # Path() does not work well + cmd[0] = locate_binary(cmd[0]) self.cmd = cmd self.callbacks = callbacks or {}