1
0
Fork 0

asdf direnv

This commit is contained in:
Ava Gaiety W 2023-09-13 11:35:21 -04:00
parent c91a7eaab1
commit 7fd3a00dc7
4 changed files with 50 additions and 13 deletions

8
.obsidian/types.json vendored Normal file
View file

@ -0,0 +1,8 @@
{
"types": {
"aliases": "aliases",
"cssclasses": "multitext",
"tags": "tags",
"date": "date"
}
}

View file

@ -13,7 +13,7 @@
"state": { "state": {
"type": "markdown", "type": "markdown",
"state": { "state": {
"file": "content/tils/struct_pattern_matching.md", "file": "content/tils/asdf_direnv.md",
"mode": "source", "mode": "source",
"source": false "source": false
} }
@ -85,7 +85,7 @@
"state": { "state": {
"type": "backlink", "type": "backlink",
"state": { "state": {
"file": "content/tils/struct_pattern_matching.md", "file": "content/tils/asdf_direnv.md",
"collapseAll": false, "collapseAll": false,
"extraContext": false, "extraContext": false,
"sortOrder": "alphabetical", "sortOrder": "alphabetical",
@ -105,13 +105,23 @@
"sortOrder": "frequency" "sortOrder": "frequency"
} }
} }
},
{
"id": "7f987208866df706",
"type": "leaf",
"state": {
"type": "file-properties",
"state": {
"file": "content/tils/asdf_direnv.md"
}
}
} }
] ],
"currentTab": 2
} }
], ],
"direction": "horizontal", "direction": "horizontal",
"width": 300, "width": 300
"collapsed": true
}, },
"left-ribbon": { "left-ribbon": {
"hiddenItems": { "hiddenItems": {
@ -122,8 +132,14 @@
"markdown-importer:Open format converter": false "markdown-importer:Open format converter": false
} }
}, },
"active": "73b3910cd9e889d3", "active": "7f987208866df706",
"lastOpenFiles": [ "lastOpenFiles": [
"content/tils/struct_pattern_matching.md",
"content/tils/asdf_direnv.md",
"_site/tils/asdf_direnv/index.html",
"_site/tils/asdf_direnv",
"_site/tils/Untitled/index.html",
"_site/tils/Untitled",
"styles/prism-dracula.css", "styles/prism-dracula.css",
"node_modules/@11ty/eleventy-plugin-syntaxhighlight/syntax-highlight.webc", "node_modules/@11ty/eleventy-plugin-syntaxhighlight/syntax-highlight.webc",
"node_modules/@11ty/eleventy-plugin-syntaxhighlight/README.md", "node_modules/@11ty/eleventy-plugin-syntaxhighlight/README.md",
@ -131,11 +147,6 @@
"node_modules/@11ty/eleventy-plugin-syntaxhighlight/src/markdownSyntaxHighlightOptions.js", "node_modules/@11ty/eleventy-plugin-syntaxhighlight/src/markdownSyntaxHighlightOptions.js",
"node_modules/@11ty/eleventy-plugin-syntaxhighlight/src/hasTemplateFormat.js", "node_modules/@11ty/eleventy-plugin-syntaxhighlight/src/hasTemplateFormat.js",
"node_modules/@11ty/eleventy-plugin-syntaxhighlight/src/getAttributes.js", "node_modules/@11ty/eleventy-plugin-syntaxhighlight/src/getAttributes.js",
"node_modules/@11ty/eleventy-plugin-syntaxhighlight/src/PrismNormalizeAlias.js",
"node_modules/@11ty/eleventy-plugin-syntaxhighlight/src/PrismLoader.js",
"node_modules/@11ty/eleventy-plugin-syntaxhighlight/src/LiquidHighlightTag.js",
"node_modules/@11ty/eleventy-plugin-syntaxhighlight/src/HighlightPairedShortcode.js",
"node_modules/@11ty/eleventy-plugin-syntaxhighlight/src/HighlightLinesGroup.js",
"node_modules/@11ty/eleventy-plugin-syntaxhighlight/test/issue-80/index.md", "node_modules/@11ty/eleventy-plugin-syntaxhighlight/test/issue-80/index.md",
"node_modules/@11ty/eleventy-plugin-syntaxhighlight/demo/test-markdown.md", "node_modules/@11ty/eleventy-plugin-syntaxhighlight/demo/test-markdown.md",
"node_modules/prismjs/README.md", "node_modules/prismjs/README.md",
@ -158,8 +169,6 @@
"node_modules/liquidjs/node_modules/commander/Readme.md", "node_modules/liquidjs/node_modules/commander/Readme.md",
"node_modules/minipass/node_modules/yallist/README.md", "node_modules/minipass/node_modules/yallist/README.md",
"node_modules/minipass/README.md", "node_modules/minipass/README.md",
"node_modules/filelist/node_modules/minimatch/README.md",
"node_modules/filelist/node_modules/brace-expansion/README.md",
"_site/images/ultimate-dungeon-terrain-3.jpg", "_site/images/ultimate-dungeon-terrain-3.jpg",
"_site/images/ultimate-dungeon-terrain-2.jpg", "_site/images/ultimate-dungeon-terrain-2.jpg",
"_site/images/ultimate-dungeon-terrain-1.jpg", "_site/images/ultimate-dungeon-terrain-1.jpg",

View file

@ -169,6 +169,8 @@
}, },
"active": "f1067e4ded36bae9", "active": "f1067e4ded36bae9",
"lastOpenFiles": [ "lastOpenFiles": [
"tils/asdf_direnv.md",
"tils/Untitled.md",
"tils/tils.json", "tils/tils.json",
"tils/struct_pattern_matching.md", "tils/struct_pattern_matching.md",
"til.md", "til.md",

View file

@ -0,0 +1,18 @@
---
title: asdf with direnv to load env variables automatically
date: 2023-06-26
---
[asdf](https://asdf-vm.com/) is a powerful tool to manage runtime versions based on the project you're in, but it can do so much more. Beyond just switching a ruby, node, elixir etc version there are plugins like [asdf-direnv](https://github.com/asdf-community/asdf-direnv#usage) which can automatically leverage the [direnv](https://direnv.net/) tool as a way to set up per-project environment variables.
```shell
asdf plugin-add direnv
asdf direnv setup --shell bash --version latest
```
Now, you may navigate to your project you need to export variables for and run `direnv allow .` and create a `.envrc` file like the following:
```shell
export FOO=BAR
```
Now the next time you change directory to this project `$FOO` should automatically be exported!