Skip to content

Commit

Permalink
Refactor cmd path check using startswith() (#3117)
Browse files Browse the repository at this point in the history
  • Loading branch information
codefiles authored Jan 14, 2025
1 parent b7a5d00 commit d5bbda1
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions archinstall/lib/general.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,8 @@ def __init__(
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 {}
Expand Down

0 comments on commit d5bbda1

Please sign in to comment.