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

Official curl ... | bash install not adding pixi to PATH when ~/.zshrc missing #403

Closed
2 tasks done
humphd opened this issue Oct 23, 2023 · 1 comment · Fixed by #408
Closed
2 tasks done

Official curl ... | bash install not adding pixi to PATH when ~/.zshrc missing #403

humphd opened this issue Oct 23, 2023 · 1 comment · Fixed by #408
Labels
🐞 bug Something isn't working

Comments

@humphd
Copy link
Contributor

humphd commented Oct 23, 2023

Checks

  • I have checked that this issue has not already been reported.

  • I have confirmed this bug exists on the latest version of pixi, using pixi --version.

Reproducible example

curl -fsSL https://pixi.sh/install.sh | bash

Issue description

Running the official installation command on macOS is not adding pixi to the PATH. I've tried on 3 different Macs tonight, some new (M1) some old, they all have the same issue.

Each one is using the default zsh shell. Running curl -fsSL https://pixi.sh/install.sh | bash (or even curl -fsSL https://pixi.sh/install.sh | zsh) results in ~/.pixi/bin/pixi being installed, but the PATH environment variable isn't updated.

Debugging this a bit, I notice that machines where people haven't done much setup before don't have ~/.zshrc, so it's skipping updating PATH.

Expected behavior

I'd expect pixi to become executable. I'm trying to get new users working with pixi, and this is a blocker for people who are new, and will assume the install failed.

Looking at the install script, I wonder if update_shell() should be improved to create the file if it's missing?

update_shell() {
    FILE=$1
    LINE=$2

    # Create the file if it doesn't exist
    if [ ! -f "$FILE" ]; then
        touch "$FILE"
    fi

    # Append the line if it's not already in the file
    if ! grep -Fxq "$LINE" "$FILE"
    then
        echo "Updating '${FILE}'"
        echo "$LINE" >> "$FILE"
    fi
}
@humphd humphd added the 🐞 bug Something isn't working label Oct 23, 2023
@ruben-arts
Copy link
Contributor

He @humphd, good catch! feel free to make a PR with your fix!

Nice to hear that the first thing you do on a new system is install pixi 😉 !

ruben-arts pushed a commit that referenced this issue Oct 24, 2023
Fixes #403

This updates `install.sh` to create the required dot file instead of
silently skipping the addition of `PATH`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants