https://github.com/excid3/asdf-vars
An asdf extension that safely sets global and per-project environment variables, based upon rbenv
https://github.com/excid3/asdf-vars
asdf asdf-plugin asdf-vars rbenv-vars
Last synced: 6 months ago
JSON representation
An asdf extension that safely sets global and per-project environment variables, based upon rbenv
- Host: GitHub
- URL: https://github.com/excid3/asdf-vars
- Owner: excid3
- License: mit
- Created: 2018-10-02T00:11:28.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2023-12-28T14:37:36.000Z (almost 2 years ago)
- Last Synced: 2025-03-31T01:23:25.926Z (7 months ago)
- Topics: asdf, asdf-plugin, asdf-vars, rbenv-vars
- Language: Shell
- Size: 8.79 KB
- Stars: 19
- Watchers: 2
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# asdf-vars
An asdf extension that safely sets global and per-project environment variables, based upon rbenvThis is basically a port of the [rbenv-vars plugin](https://github.com/rbenv/rbenv-vars/).
# Install
Make sure you already have [asdf](https://github.com/asdf-vm/asdf#setup) installed before following these steps.
```bash
asdf plugin add vars https://github.com/excid3/asdf-vars
```Add the following to `~/.asdf/lib/commands/command-exec.bash` before it executes the shim.
```bash
eval "$($ASDF_DIR/bin/asdf vars)"
with_shim_executable "$shim_name" exec_shim || exit $?
```# Usage
Define environment variables in an `.asdf-vars` file in your project,
one variable per line, in the format `VAR=value`. For example:RUBY_GC_MALLOC_LIMIT=50000000
RUBY_HEAP_MIN_SLOTS=15000
RUBY_FREE_MIN=4096You can perform variable substitution with the traditional `$`
syntax. For example, to append to `GEM_PATH`:GEM_PATH=$GEM_PATH:/u/shared/gems
Spaces are allowed in values; quoting is not necessary. Expansion and
command substitution are not allowed. Lines beginning with `#` or any
lines not in the format VAR=value will be ignored.Variables specified in the `~/.asdf/vars` file will be set
first. Then variables specified in `.asdf-vars` files in any parent
directories of the current directory will be set. Variables from the
`.asdf-vars` file in the current directory are set last.# Author
* [Chris Oliver](https://github.com/excid3)
# License
© 2018-2020 Chris Oliver. Released under the MIT license. See LICENSE for details.