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

Crash upon first attempt to use #17

Closed
MostHated opened this issue Apr 7, 2023 · 4 comments
Closed

Crash upon first attempt to use #17

MostHated opened this issue Apr 7, 2023 · 4 comments

Comments

@MostHated
Copy link

MostHated commented Apr 7, 2023

Describe the bug
I tried to follow the steps from the usage.md but it crashed out on step 1

To Reproduce
Steps to reproduce the behavior:

zsh ❯ cargo install envio
    Updating crates.io index
  Downloaded envio v0.4.1
  Downloaded 1 crate (121.1 KB) in 0.51s
  Installing envio v0.4.1
    Updating crates.io index
  ...
  ...

zsh ❯ envio create me
    Creating config directory
    Creating shellscript
    thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 2, kind: NotFound, message: "No such file or directory" }', /home/mosthated/.cargo/registry/src/index.crates.io-6f17d22bba15001f/envio-0.4.1/src/bin/envio/main.rs:66:18
    note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Device (please complete the following information):

  • OS: Pop_os 22.04
  • Shell: zsh
  • CLI Version: envio v0.4.1

Note
I ran the command again and it asked me for an encryption key. So hopefully things are fine, but I did want to make sure to report this issue.

@humblepenguinn
Copy link
Collaborator

Does the config file for your shell exist?
~/.zshrc

@MostHated
Copy link
Author

It does, but I use a .zshenv file, and in there my $ZDOTDIR="$HOME/.zsh/" so my zshrc is $HOME/.zsh/.zshrc

@humblepenguinn
Copy link
Collaborator

I see, so that seems like the issue.

envio assumes your shell config file to be in your home directory.

And the reason it worked the second time is beacuse the tool checks to see if the config directory exists. If it does not it assumes to be a fresh install and sets everything up. In your case it created the config directory and then threw an error when locating the shell config file.

So when you ran the tool the second time it saw that the config directory exists and skipped all the fresh install steps.

You won't be able to use the envio load and envio unload command.

You have to keep your .zshrc file in your home directory and delete the config directory ~/.envio as well. Then you can fire up the tool and it should work normally.

Or you can wait until I get a fix in with the next release which is going to be tomorrow or the day after.

Thank you for opening the issue and letting me know!

@MostHated
Copy link
Author

MostHated commented Apr 7, 2023

No worries. It would be a relatively major undertaking to relocate everything, so I have no problem waiting, no rush.

I had noticed what you mentioned about load and unload not working in zsh. I could see the var if I did envio list me, so I was going to report it as well, but suspected it was related to the initial issue. So it all makes plenty of sense now, though.

Edit:


Not sure if it would also come into play for PowerShell, but my pwsh profile on this same machine is located in:

/home/mosthated/.config/powershell/Microsoft.PowerShell_profile.ps1

From there, I source a different file which contains all my actual profile stuff in ~/.dotfiles/.pwsh/pwsh_profile.ps1

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

No branches or pull requests

2 participants