You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
resholve fails to parse aliases with = chars in their definition because aliases are split with .split('=')here, this breaks derivation realisation whether or not solutions.default.fix.aliases is set to true.
> File "/nix/store/bmnmsvgqamwdcvybicmw5hkv1lanihnh-resholve-0.10.5/bin/.resholve-wrapped", line 3509, in handle_builtin_alias
> alias, definition = word.strip("\"='").split("=")
> ValueError: too many values to unpack
patching resholve as follows to only split on the first occurrence of = fixed it for me, I'm willing to create a PR for this if you don't mind.
diff --git a/resholve b/resholve
index c163fa9..e0581bc 100755
--- a/resholve+++ b/resholve@@ -3506,7 +3506,7 @@ class RecordCommandlike(object):
if word.ok:
# not dynamic; more examples in tests/aliases.sh, but:
# 'd', 'echo $SOURCE_DATE_EPOCH'
- alias, definition = word.strip("\"='").split("=")+ alias, definition = word.strip("\"='").split("=", 1)
# TODO: maybe below deserves an explicit API
cmdlikes[alias].alias = True
commandlike = definition.split()[0]
The text was updated successfully, but these errors were encountered:
janw4ld
changed the title
issue parsing aliases that contain = inside them
parsing aliases with = inside them fails
Oct 29, 2024
janw4ld
changed the title
parsing aliases with = inside them fails
parsing aliases with = inside them fails with ValueError: too many values to unpackOct 29, 2024
resholve fails to parse aliases with
=
chars in their definition because aliases are split with.split('=')
here, this breaks derivation realisation whether or notsolutions.default.fix.aliases
is set to true.example alias that triggers the issue:
ssh_prod='ssh $(AWS_REGION=us-east-1 ssm-machine jump)'
error emitted during evaluation:
patching resholve as follows to only split on the first occurrence of
=
fixed it for me, I'm willing to create a PR for this if you don't mind.The text was updated successfully, but these errors were encountered: