xJonathanLEI / starkli

Starkli (/ˈstɑːrklaɪ/), a ⚡ blazing ⚡ fast ⚡ CLI tool for Starknet powered by 🦀 starknet-rs 🦀
https://book.starkli.rs
Apache License 2.0
164 stars 47 forks source link

zsh shell not detected when installing #7

Closed barretodavid closed 1 year ago

barretodavid commented 1 year ago

I'm using zsh on Mac with oh-my-zsh and when I try to install Starkli using:

curl https://get.starkli.sh | sh

I get the message:

Shell detection variables (for debugging use):
- ZSH_NAME =
- SHELL = /bin/zsh

starkliup: could not detect shell. Add '. /Users/david/.starkli/env' to your shell profile, or manually add '/Users/david/.starkli/bin' to your PATH environment variable.

Not a big deal but it would be nice if I could avoid having to add the path to my config file manually

ClementWalter commented 1 year ago

regarding zsh, for completion , could be nice to add somewhere this in the future doc

starkli completions zsh > ~/.oh-my-zsh/completions/_starkli

I always loose~15minutes trying to remember the exact path to put this..!

xJonathanLEI commented 1 year ago

@ClementWalter zsh completion is automatically handled. You shouldn't need to do this.

The real problem is that shell completion is only activated when the shell itself is detected, and that zsh is not properly detected, i.e. this issue.

xJonathanLEI commented 1 year ago

I just pushed an update: https://github.com/xJonathanLEI/starkli/commit/7fb0d5c1f792ff679fcdfc73d461a88c7d883280

@barretodavid Could you please try the curl installation command again to see if it's fixed?

@ClementWalter Cloud you please test if command completion works now? (you might need to delete your custom completion and start a new terminal session first)

Thanks!

barretodavid commented 1 year ago

@xJonathanLEI I just tried on an Ubuntu VM but same issue:

$ curl https://get.starkli.sh | sh
>>>

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  3530  100  3530    0     0   5737      0 --:--:-- --:--:-- --:--:--  5730
Installing starkliup...
######################################################################## 100.0%

Shell detection variables (for debugging use):
- ZSH_NAME = 
- SHELL = /usr/bin/zsh

Run '. /home/parallels/.starkli/env' or start a new terminal session to use starkliup.
Then, simply run starkliup to install starkli.

Tried restarting the console but starkliup is not found

$ starkliup
>>>
zsh: command not found: starkliup

I'm using zsh with oh-my-zsh

ClementWalter commented 1 year ago

@xJonathanLEI I did

cargo uninstall starkli
rm -rf ~/.oh-my-zsh/completions/_starkli
cargo install --locked starkli
exec $SHELL

no completion

xJonathanLEI commented 1 year ago

@ClementWalter Installing from source won't (and shouldn't) work. Shell completion is only done for installation via starkliup.

(IMO cargo install shouldn't introduce any side effects other than installing the binary itself)

xJonathanLEI commented 1 year ago

@barretodavid Maybe you're using .zshrc? I just pushed yet another update: https://github.com/xJonathanLEI/starkli/commit/b2c5fd77f958ae9f2d90bc373c96f5c89c2607bc

Maybe this will fix your issue. Could you please try again? Thank you!

barretodavid commented 1 year ago

Should I use the same command curl https://get.starkli.sh | sh to install that latest update?

barretodavid commented 1 year ago

Because I just tried and got the same issue. And yes, I'm using .zshrc

xJonathanLEI commented 1 year ago

Communicated with @barretodavid on Telegram and confirmed that this issue is actually gone. zsh should now be properly supported. Closing this issue now.