Last active
December 6, 2024 13:37
-
-
Save coderofsalvation/141e9ef881357525101b38ac7f5bc68f to your computer and use it in GitHub Desktop.
autoenv/direnv in one shell function
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# minimalist version of https://github.com/hyperupcall/autoenv | |
cd(){ | |
test -f .env.leave && source .env.leave # cleanup environment | |
builtin cd ${1:+"$@"} && { | |
test -f .env && source .env # setup environment / run scripts e.g. | |
test -d .git && git remote -v # react to implicit metadata | |
ls # list directories | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment