Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix add element to list in zsh if the element contains an environment variable #13

Merged

Conversation

traversaro
Copy link
Member

In particular, avoid to escape the argument of the ensure_quotes function in zsh, as done in bash

… variable

In particular, avoid to escape the argument of the ensure_quotes function in zsh, as done in bash
@traversaro
Copy link
Member Author

Without this fix, msh lines such as:

	sys.list_append("XDG_DATA_DIRS", path.join(env("CONDA_PREFIX"), "share"))

resulted in the following line being generated in bash:

    pathappend "$CONDA_PREFIX/share" XDG_DATA_DIRS

while on zsh:

    listappend "\$CONDA_PREFIX/share" XDG_DATA_DIRS

The fact that the initial $ is escaped actually breaks the correct evaluation of the environment variable, see robotology/robotology-superbuild#779 (comment) . The fix is actually to remove the re.escape calls in ensure_quotes of zsh, to align it with the same function for bash. This modification pass all the existing tests.

@wolfv wolfv merged commit 1a4df91 into mamba-org:main Jun 29, 2021
@wolfv
Copy link
Member

wolfv commented Jun 29, 2021

Thanks!

@traversaro
Copy link
Member Author

I tried to add a regression test for this issue in #12, but that test is failing on xonsh for an unrelated reason. Unfortunatly I have limited xonsh experience.

@wolfv
Copy link
Member

wolfv commented Jun 29, 2021

I can take a look later, let's leave the other PR open for now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants