redxtech / zsh-asdf-direnv

A zsh plugin that loads asdf & asdf-direnv.
MIT License
11 stars 9 forks source link

Reinstalls direnv on every new shell if direnv config isn't in ~/.direnv #4

Closed zetlen closed 1 year ago

zetlen commented 1 year ago

Since the most recent update, I see log messages about installing direnv on every new login shell.

Last login: Mon Oct 24 09:33:55 on console
[zsh-asdf-direnv] Installing direnv...
[zsh-asdf-direnv] -> direnv install OK
~ ❯

The latest release adds a check if direnv is already installed, but I think it's making a faulty assumption here:

[[ ! -d "~/.direnv" ]] && _zsh_asdf_direnv_install_direnv

I'm not sure this is the only standard location for the direnv config directory; I've had direnv for a long time and I don't have this directory. Based on the direnv manual this isn't the only place that direnv configuration can go. Maybe there's another way to determine whether direnv is installed.

Steps to reproduce

  1. From a blank home directory, install asdf and zsh-asdf-direnv
  2. Observe that this is logged:
    [zsh-asdf-direnv] Installing direnv...
    [zsh-asdf-direnv] -> direnv install OK
  3. Close the shell and logout
  4. Log back in
  5. Observe the same log messages as in 2.