envio-cli / envio

Envio is a modern and secure command-line tool that simplifies the management of environment variables
https://envio-cli.github.io
Apache License 2.0
760 stars 12 forks source link

Failed to unload env var in my windows. #65

Open ulic-youthlic opened 1 month ago

ulic-youthlic commented 1 month ago

Describe the bug When I try to unload the profile, it fails. I tried to reload my shell, but the environment variables were still there. the report is as following:

Reload your shell to apply changes
ERROR: Invalid syntax.
Type "REG DELETE /?" for usage.

To Reproduce Steps to reproduce the behavior:

  1. Create a profile. envio create lab -g select
  2. add env var. envio add lab -e WEB_ADDRESS="127.0.0.1:8080"
  3. load it. envio load lab
  4. unload it. envio unload lab
  5. restart my terminal.
  6. echo the env var. echo $Env:WEB_ADDRESS

Expected behavior The environment variable WEB_ADDRESS remains after unloading the profile.

Screenshots If applicable, add screenshots to help explain your problem. image image

Device (please complete the following information):

Additional context I can still find WEB_ADDRESS in the registry.

humblepenguinn commented 4 weeks ago

@ulic-youthlic, I've just pushed a commit that should resolve the issue. Test it out and let me know

ulic-youthlic commented 4 weeks ago

I cloned this repository and then installed it using cargo install --path .. Now, I have good news and bad news: It works, but not completely (maybe).


Here’s the process I followed:

  1. Created a profile named "test"
  2. Added an environment variable Port=2333
  3. Loaded this profile
  4. Printed the environment variable directly, no response
  5. Restarted my terminal
  6. Printed Port, output was 2333
  7. Unloaded the profile, output was successful
  8. Printed Port, output was 2333
  9. Restarted the terminal
  10. Printed Port, output was 2333
  11. Restarted the computer
  12. Printed Port, no output

Yes, the latest envio can indeed correctly delete environment variables, but the problem is that Windows seems to be a bit slow to react and requires a computer restart to properly update the environment variables. Anyway, thanks for all you've done.