Skip to content

Conversation

@joshchngs
Copy link
Contributor

I recently installed Fluvio from the online installer, but I felt left out when it came time to adding the bindir to my path.

The first commit is the important one, the others just clean the output up slightly, now there are 3 variants.

@sehz
Copy link

sehz commented May 18, 2022

Thanks for contribution

@sehz sehz requested a review from tjtelan May 18, 2022 15:57
Copy link
Contributor

@tjtelan tjtelan left a comment

Choose a reason for hiding this comment

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

This works as expected using bash and zsh, but it doesn't seem to work at all with fish.

In each of my examples, the user has the variant shell set as their login, to ensure the $SHELL var is set correctly. This should always return the same value even if you were to pipe the script to a different shell.

bash

bashy@2ad9c674bbea:~$ echo $SHELL
/bin/bash
bashy@2ad9c674bbea:~$ cat install.sh | bash
[...]
fluvio:       echo 'export PATH="${HOME}/.fluvio/bin:${PATH}"' >> ~/.bashrc

zsh

2ad9c674bbea% echo $SHELL
/usr/bin/zsh
2ad9c674bbea% cat install.sh|zsh
[...]
fluvio:       echo 'export PATH="${HOME}/.fluvio/bin:${PATH}"' >> ~/.zshrc

For me, the script has an error if I try to execute w/ fish

fishy@2ad9c674bbea ~> echo $SHELL
/usr/bin/fish

fishy@2ad9c674bbea ~> cat install.sh | fish
fish: Unexpected ')' found, expecting '}'
        x86_64-unknown-linux-gnu)
                                ^

This would print fish_hint, but there's a little typo.

fishy@2ad9c674bbea ~ [0|127]> cat install.sh | bash
[...]
fluvio:       echo 'export PATH="${HOME}/.fluvio/bin:${PATH}"' >> ~/.bashrc

fishy@2ad9c674bbea ~> cat install.sh | zsh
[...]
fluvio:       echo 'export PATH="${HOME}/.fluvio/bin:${PATH}"' >> ~/.bashrc

When I changed L159 to fish_hint, this does print correctly, however.

fishy@2ad9c674bbea ~> cat install.sh | zsh
[...]
fluvio:       fish_add_path "$HOME/.fluvio/bin"

joshchngs added 3 commits May 19, 2022 09:00
The shell is detected based on the bin name, and remind_path
reverts to the previous behaviour (print all hints) if the
detection fails.
Makes it a little easier to see which part to copy/paste
in the fallthrough case (where shell can't be detected).
@joshchngs joshchngs force-pushed the install-fish-path branch from 06b4bba to ba40b23 Compare May 19, 2022 08:00
@joshchngs
Copy link
Contributor Author

This isn't intended to execute under fish - that wouldn't work. The install flow should stay the same - curl | bash.

The change is just that the PATH-setting instructions are emitted differently. Here's how it looks for me (on fish):
Screenshot 2022-05-19 at 09 04 12
:

@sehz
Copy link

sehz commented May 19, 2022

can you add to changelog?

@joshchngs
Copy link
Contributor Author

Sure. I didn't make an issue like the other entries - just link to this PR?

Copy link

@sehz sehz left a comment

Choose a reason for hiding this comment

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

Great. thanks

@sehz
Copy link

sehz commented May 19, 2022

bors r+

1 similar comment
@sehz
Copy link

sehz commented May 20, 2022

bors r+

bors bot pushed a commit that referenced this pull request May 20, 2022
I recently installed Fluvio from the online installer, but I felt left out when it came time to adding the bindir to my path.

The first commit is the important one, the others just clean the output up slightly, now there are 3 variants.
@bors
Copy link

bors bot commented May 20, 2022

Pull request successfully merged into master.

Build succeeded:

@bors bors bot changed the title Add fish support to install.sh [Merged by Bors] - Add fish support to install.sh May 20, 2022
@bors bors bot closed this May 20, 2022
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.

3 participants