asdf-community / asdf-golang

Go plugin for the asdf version manager
https://github.com/asdf-vm/asdf
MIT License
534 stars 88 forks source link

Use built-in zsh function to get absolute dir path for golang #105

Closed egaldamez closed 1 year ago

egaldamez commented 1 year ago

Hello, I've recently started using this project in combination with direnv and noticed a small improvement. What's happening is the following

  1. I cd into a directory with a .envrc file
  2. Any command that's executed within this directory will always trigger an direnv: unloading hook

After some research, I found that this issue was related to set-env.zsh and the use of absolute_dir_path. In fact, I found a similar issue which was resolved: https://github.com/halcyon/asdf-java/pull/144

In summary, the fix uses zsh's built in functionality to get the absolute dir path. This makes absolute_dir_path obsolete 🙂.