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

feat(install): Add PIXI_NO_PATH_UPDATE for PATH update suppression #692

Merged

Conversation

chawyehsu
Copy link
Contributor

Close #686

The PR mainly adds the option of using a PIXI_NO_PATH_UPDATE environment variable to suppress PATH update, when installing pixi from install script.

Besides the option added, since the PR is about environment variable, the way of updating PATH in the PowerShell install script has also been modified from using [Environment]::SetEnvironmentVariable to set environment variable to get and update environment variable from Windows registry.

This change doesn't affect pixi installation directly and is primarily to address a potential issue that SetEnvironmentVariable expands all environment variables and this behavior may not be welcomed in some cases.

$Env:PATH
#> %USERPROFILE%\bin;

# when using `SetEnvironmentVariable` to update PATH, `%USERPROFILE%` will be expanded
#> C:\Users\userA\bin;C:\pixi\bin

# when using registry to update PATH, `%USERPROFILE%` will be kept unexpanded
#> %USERPROFILE%\bin;C:\pixi\bin

Related code are copied from ScoopInstaller/Install I'm maintaining.

Copy link
Contributor

@ruben-arts ruben-arts left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

)

Set-StrictMode -Version Latest

function Publish-Env {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool wasn't aware you could do this!

@ruben-arts ruben-arts merged commit ce255da into prefix-dev:main Jan 20, 2024
11 checks passed
@chawyehsu chawyehsu deleted the feature/install-no-path-update branch January 28, 2024 13:52
@mariusvniekerk
Copy link
Contributor

This PR breaks the installer for linux in some cases where it fails with

bash: line 83: PIXI_NO_PATH_UPDATE: unbound variable

wolfv pushed a commit that referenced this pull request Jan 30, 2024
The linux installer was broken by #692 and fails currently with `bash: line 83: PIXI_NO_PATH_UPDATE: unbound variable`
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.

add env var option in install.sh to not update ~/.profile
4 participants