livebud / bud

The Full-Stack Web Framework for Go
MIT License
5.53k stars 182 forks source link

build: add `direnv` support and integrate with `asdf` #396

Closed wheinze closed 1 year ago

wheinze commented 1 year ago

In reply to the last PR:

Hmm... just tried it. Getting:

direnv: loading ~/dev/src/github.com/livebud/bud/.envrc                                                        
direnv: using asdf
/bin/bash:1033: use_asdf: command not found

Sorry, I should have been a bit more clear. Basically, I'd like this to support the following matrix:

  • no direnv, no asdf, no problem
  • direnv, no asdf, no problem
  • asdf, no direnv, no problem
  • asdf, direnv, yayyyy

Reverting for now, but happy to merge once this is sorted.

Oh i c, asdf seemed to be present, but asdf-direnv wasn't installed / set up. So this player should be added to the matrix as well ;)

Added a check for that one that ensures to have the direnv integration set up correctly for asdf.

(Note: https://github.com/asdf-community/asdf-direnv#setup describes how to set it up. When installed correctly, a util function called use_asdf() will be placed inside ~/.config/direnv/lib/use_asdf.sh.)

matthewmueller commented 1 year ago

Sorry for the delay and thanks for improving this Waldemar!

I just tested the branch under some scenarios and it's working as expected. Thank you for this contribution!