asdf as environment manager
so much faster
- tags
- asdf
Contents
I've switch to using asdf to manage my computers version of different
programming environments. This is both a more unified approach to
using both nvm
and rbenv
, since it handles a lot more programming
languages, but the implementation is also faster.
Installing asdf
Go to the asdf getting started page to get the latest version:
|
|
Then add this to your ~/.bashrc
:
|
|
Add a plugin
Different languages are supported using plugins, so first we need to install a plugin. For example:
|
|
Updating plugins
asdf
itself has the code to manage the environment directories and
keeping track of the packages. The plugins
know all about a specific
environment. So if you want to get the latest version of, say, deno,
you need to update the plugin because that's where the build
instructions live.
|
|
Installing a version
This will list all available versions for a specific environment:
|
|
We can install the latest with:
|
|
∗ Downloading and installing deno... Archive: /home/wschenk/.asdf/installs/deno/1.8.1/bin/deno.zip inflating: /home/wschenk/.asdf/installs/deno/1.8.1/bin/deno The installation was successful!
We can install a specific version with:
|
|
∗ Downloading and installing deno... Archive: /home/wschenk/.asdf/installs/deno/1.6.3/bin/deno.zip inflating: /home/wschenk/.asdf/installs/deno/1.6.3/bin/deno The installation was successful!
Selecting a version to use
There are 3 different scopes for usage:
global | written into ~/.tool-version , the default unless overridden |
shell | the version that the current shell defaults to |
local | written into $PWD/.tool-version, overridden by directory |
In our case, I'm going to do
|
|
Then
|
|
deno 1.6.3 (release, x86_64-unknown-linux-gnu) v8 8.8.294 typescript 4.1.3
Conclusion
There seems to be a lot less shell overhead when using asdf
vs rbenv
and all the other ones, so I found that in practice it really sped up
my system when running something that created a lot of subshells
(./configure
for example.)
Previously
Next