mirror of
https://github.com/xonsh/xonsh.git
synced 2025-03-04 08:24:40 +01:00
SpecModifierAlias: micro move (#5464)
It's needed to put spec modifier to the end of resolving. ## For community ⬇️ **Please click the 👍 reaction instead of leaving a `+1` or 👍 comment** Co-authored-by: a <1@1.1>
This commit is contained in:
parent
aaf3c99a3b
commit
2908f4da17
1 changed files with 4 additions and 5 deletions
|
@ -705,7 +705,7 @@ class SubprocSpec:
|
|||
def resolve_alias(self):
|
||||
"""Sets alias in command, if applicable."""
|
||||
cmd0 = self.cmd[0]
|
||||
|
||||
spec_modifiers = []
|
||||
if cmd0 in self.alias_stack:
|
||||
# Disabling the alias resolving to prevent infinite loop in call stack
|
||||
# and futher using binary_loc to resolve the alias name.
|
||||
|
@ -715,7 +715,6 @@ class SubprocSpec:
|
|||
if callable(cmd0):
|
||||
alias = cmd0
|
||||
else:
|
||||
spec_modifiers = []
|
||||
if isinstance(XSH.aliases, dict):
|
||||
# Windows tests
|
||||
alias = XSH.aliases.get(cmd0, None)
|
||||
|
@ -723,10 +722,10 @@ class SubprocSpec:
|
|||
alias = XSH.aliases.get(cmd0, None, spec_modifiers=spec_modifiers)
|
||||
if alias is not None:
|
||||
self.alias_name = cmd0
|
||||
if spec_modifiers:
|
||||
for mod in spec_modifiers:
|
||||
self.add_spec_modifier(mod)
|
||||
self.alias = alias
|
||||
if spec_modifiers:
|
||||
for mod in spec_modifiers:
|
||||
self.add_spec_modifier(mod)
|
||||
|
||||
def resolve_binary_loc(self):
|
||||
"""Sets the binary location"""
|
||||
|
|
Loading…
Add table
Reference in a new issue