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

wip #37

Merged
merged 2 commits into from
Aug 22, 2020
Merged

wip #37

merged 2 commits into from
Aug 22, 2020

Conversation

vic
Copy link
Member

@vic vic commented Dec 11, 2019

This branch has some major changes:

  • Recommend having a wrapper direnv function so that people dont have to write asdf exec direnv stuff
  • Old shim is now part of asdf direnv extension command.
  • You can have an .envrc with use asdf even if the directory has no .tool-versions file. All asdf current tools will be activated. In alphabetical order, since we only preserve PATH order when a .tool-versions file is present.
  • Remove all variants of use asdf * have been removed.
    • Doing use asdf will just ask asdf which versions are available in current directory.
    • use asdf local/global were just internal apis and not intended for people to use.
    • use asdf tool version was a bad choice since people should store versions on their .tool-versions file.

Still working on tests.

https://github.com/asdf-community/asdf-direnv/blob/direnv_command/README.md

Perhaps we should start creating releases.

@vic vic self-assigned this Dec 11, 2019
@vic vic force-pushed the direnv_command branch 3 times, most recently from 539244e to 7b75024 Compare December 11, 2019 05:43
@smorimoto smorimoto added the enhancement New feature or request label Dec 11, 2019
@jason0x43
Copy link

use asdf tool version was a bad choice since people should store versions on their .tool-versions file.

Being able to call use asdf tool version is nice, though, because it lets me manage all my local environment settings in one place. It seems much cleaner than having to maintain a separate .tool-versions file.

@jason0x43
Copy link

But I can see the value in trying to stick with standard behavior.

@noahgaertner
Copy link

I just tried this PR by merging it onto the repo here and it's giving me this error

/home/username/.config/direnv/direnvrc:2: : No such file or directory

direnv: loading /.envrc

direnv: using asdf

environment:732: use_asdf: command not found

@michi-zuri
Copy link
Contributor

/home/username/.config/direnv/direnvrc:2: : No such file or directory

Can you post the contents of your direnvrc file?

@noahgaertner
Copy link

/home/username/.config/direnv/direnvrc:2: : No such file or directory

Can you post the contents of your direnvrc file?

sorry for the late reply, it's literally just
use asdf

@michi-zuri
Copy link
Contributor

Can you post the contents of your direnvrc file?

sorry for the late reply, it's literally just
use asdf

That doesn't sound right.
use asdf should be the content of your .envrc file in the project or home folder, while the file direnvrc config file should setup the asdf hook for direnv. It's contents should be:
source $(asdf which direnv_use_asdf)

You could of course include this line instead in every .envrc, but the global config is a more elegant way of doing it.

@michi-zuri
Copy link
Contributor

Any plans on merging this @vic ? As far as I can remember these changes made the whole setup much smoother and got rid of many edge cases. I also didn't encounter any problems.

@vic
Copy link
Member Author

vic commented Aug 22, 2020

@michi-zuri I'm on it, rebasing now. Will merge if all test are green. Thanks for testing this branch.

@vic vic force-pushed the direnv_command branch 2 times, most recently from 2288640 to 042c1b3 Compare August 22, 2020 05:34
vic and others added 2 commits August 22, 2020 01:16
- Recommend having a wrapper direnv function so that people dont have to write asdf exec direnv stuff

- Old shim is now part of asdf direnv extension command.

- You can have an .envrc with use asdf even if the directory has no .tool-versions file. All asdf current tools will be activated. In alphabetical order, since we only preserve PATH order when a .tool-versions file is present.

- Remove all variants of use asdf * have been removed.

  Doing use asdf will just ask asdf which versions are available in current directory.
  use asdf local/global were just internal apis and not intended for people to use.
  use asdf tool version was a bad choice since people should store versions on their .tool-versions file.

- Move commands to new asdf `lib/commands/*.bash` location
  See https://asdf-vm.com/#/plugins-create?id=extension-commands-for-asdf-cli
asdf direnv triggers a dirname error
@vic vic merged commit 414e584 into master Aug 22, 2020
@vic vic deleted the direnv_command branch August 22, 2020 06:21
@vic
Copy link
Member Author

vic commented Aug 22, 2020

@michi-zuri merged! be sure to update to latest asdf and also update this plugin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

Successfully merging this pull request may close these issues.

5 participants