webinstall/webi-installers

[Bug] .bashrc, etc may be updated in the wrong order

Closed this issue · 3 comments

What were you trying to install (or what else went wrong)?

Pyenv

What exactly did you do?

curl -sS https://webinstall.dev/pyenv | bash

then reload the terminal.

What went wrong?

My terminal shows up like this

Last login: Mon Jul 15 00:20:31 2024 from ::1
-bash: pyenv: command not found
-bash: pyenv: command not found
[todo-app@pc ~]$ 

Because in .bashrc these two were flipped

# added by Webi for pyenv
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"

# Generated for envman. Do not edit.
[ -s "$HOME/.config/envman/load.sh" ] && source "$HOME/.config/envman/load.sh"

Reordering this manually fixes it, as a workaround.

Which OS did you try on?

  • Mac
  • Windows
  • Linux

What type of computer (i.e. laptop, desktop, Raspberry Pi)?

  • Laptop or Desktop (amd64 / x86-64)
  • Raspberry Pi (ARM-64)
  • Other (please specify, if you know)

Ah, this appears to be an order-of-operations issue.

If you've used webi previously then it would work as expected, but when pyenv is the first install, the generic post-install steps happen after the pyenv-specific post-install steps.

I'll see if I can find an easy way to switch some of the post-install steps to be pre-install scripts.

Thanks for the report.

@willnode This is fixed in #863 and already deployed as a hotfix.

Thank you!