asdf direnv
This commit is contained in:
parent
c91a7eaab1
commit
7fd3a00dc7
4 changed files with 50 additions and 13 deletions
8
.obsidian/types.json
vendored
Normal file
8
.obsidian/types.json
vendored
Normal file
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
"types": {
|
||||
"aliases": "aliases",
|
||||
"cssclasses": "multitext",
|
||||
"tags": "tags",
|
||||
"date": "date"
|
||||
}
|
||||
}
|
35
.obsidian/workspace.json
vendored
35
.obsidian/workspace.json
vendored
|
@ -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",
|
||||
|
|
2
content/.obsidian/workspace.json
vendored
2
content/.obsidian/workspace.json
vendored
|
@ -169,6 +169,8 @@
|
|||
},
|
||||
"active": "f1067e4ded36bae9",
|
||||
"lastOpenFiles": [
|
||||
"tils/asdf_direnv.md",
|
||||
"tils/Untitled.md",
|
||||
"tils/tils.json",
|
||||
"tils/struct_pattern_matching.md",
|
||||
"til.md",
|
||||
|
|
18
content/tils/asdf_direnv.md
Normal file
18
content/tils/asdf_direnv.md
Normal 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!
|
Loading…
Add table
Reference in a new issue