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

Major flaw in PATH handling of install.sh #2188

Closed
Arcitec opened this issue Oct 2, 2024 · 4 comments · Fixed by #2189
Closed

Major flaw in PATH handling of install.sh #2188

Arcitec opened this issue Oct 2, 2024 · 4 comments · Fixed by #2189

Comments

@Arcitec
Copy link
Contributor

Arcitec commented Oct 2, 2024

The latest version of install.sh creates the PATH as follows, which breaks every user's system if they have any paths with spaces:

export PATH=~/.pixi:$PATH

The correct method is to always, always, always double-quote:

export PATH="~/.pixi:$PATH"

Furthermore, you should either be resolving the ~ or replacing it with $HOME, because ~ is not valid inside PATH. So the final code would be:

export PATH="$HOME/.pixi:$PATH"
@wolfv
Copy link
Member

wolfv commented Oct 2, 2024

Thanks @Arcitec - the code for install.sh is right here: https://github.com/prefix-dev/pixi/blob/main/install/install.sh

Do you want to send a PR?

@Arcitec
Copy link
Contributor Author

Arcitec commented Oct 2, 2024

Here's an example of every other software's PATH handling from my own .zshrc:

Image

@wolfv I was considering making a PR but I see that you support many shells, so I am not 100% comfortable doing it since I could only test Bash and ZSH.

@Arcitec
Copy link
Contributor Author

Arcitec commented Oct 2, 2024

@wolfv I suppose I could do the Bash and ZSH parts now.

@wolfv
Copy link
Member

wolfv commented Oct 2, 2024

Yes, that would already cover many users! Thank you 🙏

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 a pull request may close this issue.

2 participants