superfly / flyctl

Command line tools for fly.io services
https://fly.io
Apache License 2.0
1.43k stars 241 forks source link

install.sh suggests .bash_profile on Ubuntu #3644

Open karlhorky opened 5 months ago

karlhorky commented 5 months ago

Describe the bug

The flyctl install script at https://fly.io/install.sh is suggesting users use $HOME/.bash_profile on Ubuntu, which doesn't read this file by default

$ curl -L https://fly.io/install.sh | sh
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  1735    0  1735    0     0  12811      0 --:--:-- --:--:-- --:--:-- 12851
######################################################################## 100,0%
set update channel to shell
flyctl was installed successfully to /home/corna/.fly/bin/flyctl
Manually add the directory to your $HOME/.bash_profile (or similar)
  export FLYCTL_INSTALL="/home/corna/.fly"
  export PATH="$FLYCTL_INSTALL/bin:$PATH"
Run '/home/corna/.fly/bin/flyctl --help' to get started

This led to confusing instructions for a student, where they added the export to $HOME/.bash_profile (which appeared to be correct) and then it was not being read on Ubuntu - after opening a new terminal, flyctl could not be found:

flyctl: command not found

Maybe it would be good to suggest .bashrc on Ubuntu? (or just always .bash_profile and .bashrc?)

fly.toml

Not relevant

Command output:

See above

karlhorky commented 5 months ago

Also, I'm not sure where to report this feature suggestion for the installer, because there is only a "bug" issue type here, but I have another suggestion:

Automatically modify PATH in installer

It would be helpful if the installer at https://fly.io/install.sh would modify the PATH in correct files on all platforms

This would require reconsidering the Fly.io team position mentioned in the comment by @jsierles:

the install script will not modify your PATH

Currently, the installer script at https://fly.io/install.sh is the worst of all install options, since it requires manually editing .bash_profile, .bashrc, .zshrc, etc.

On other platforms like Windows and macOS, we luckily have Chocolatey and Homebrew which can take this over for us:

But on Linux, the Snap is the super old 0.0.7 version (2 August 2019), so we still recommend students use the install script, which has these downsides.