From 7fd3a00dc74aa4256728b0f325f555c5ef07c515 Mon Sep 17 00:00:00 2001 From: Ava Gaiety W Date: Wed, 13 Sep 2023 11:35:21 -0400 Subject: [PATCH] asdf direnv --- .obsidian/types.json | 8 ++++++++ .obsidian/workspace.json | 35 ++++++++++++++++++++------------ content/.obsidian/workspace.json | 2 ++ content/tils/asdf_direnv.md | 18 ++++++++++++++++ 4 files changed, 50 insertions(+), 13 deletions(-) create mode 100644 .obsidian/types.json create mode 100644 content/tils/asdf_direnv.md diff --git a/.obsidian/types.json b/.obsidian/types.json new file mode 100644 index 0000000..f7e6513 --- /dev/null +++ b/.obsidian/types.json @@ -0,0 +1,8 @@ +{ + "types": { + "aliases": "aliases", + "cssclasses": "multitext", + "tags": "tags", + "date": "date" + } +} \ No newline at end of file diff --git a/.obsidian/workspace.json b/.obsidian/workspace.json index e18c32a..64b3c9e 100644 --- a/.obsidian/workspace.json +++ b/.obsidian/workspace.json @@ -13,7 +13,7 @@ "state": { "type": "markdown", "state": { - "file": "content/tils/struct_pattern_matching.md", + "file": "content/tils/asdf_direnv.md", "mode": "source", "source": false } @@ -85,7 +85,7 @@ "state": { "type": "backlink", "state": { - "file": "content/tils/struct_pattern_matching.md", + "file": "content/tils/asdf_direnv.md", "collapseAll": false, "extraContext": false, "sortOrder": "alphabetical", @@ -105,13 +105,23 @@ "sortOrder": "frequency" } } + }, + { + "id": "7f987208866df706", + "type": "leaf", + "state": { + "type": "file-properties", + "state": { + "file": "content/tils/asdf_direnv.md" + } + } } - ] + ], + "currentTab": 2 } ], "direction": "horizontal", - "width": 300, - "collapsed": true + "width": 300 }, "left-ribbon": { "hiddenItems": { @@ -122,8 +132,14 @@ "markdown-importer:Open format converter": false } }, - "active": "73b3910cd9e889d3", + "active": "7f987208866df706", "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", "node_modules/@11ty/eleventy-plugin-syntaxhighlight/syntax-highlight.webc", "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/hasTemplateFormat.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/demo/test-markdown.md", "node_modules/prismjs/README.md", @@ -158,8 +169,6 @@ "node_modules/liquidjs/node_modules/commander/Readme.md", "node_modules/minipass/node_modules/yallist/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-2.jpg", "_site/images/ultimate-dungeon-terrain-1.jpg", diff --git a/content/.obsidian/workspace.json b/content/.obsidian/workspace.json index 4357b4b..eea781b 100644 --- a/content/.obsidian/workspace.json +++ b/content/.obsidian/workspace.json @@ -169,6 +169,8 @@ }, "active": "f1067e4ded36bae9", "lastOpenFiles": [ + "tils/asdf_direnv.md", + "tils/Untitled.md", "tils/tils.json", "tils/struct_pattern_matching.md", "til.md", diff --git a/content/tils/asdf_direnv.md b/content/tils/asdf_direnv.md new file mode 100644 index 0000000..17a4418 --- /dev/null +++ b/content/tils/asdf_direnv.md @@ -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! \ No newline at end of file