mirror of
https://github.com/asdf-vm/asdf.git
synced 2024-11-15 09:38:16 -07:00
31 lines
25 KiB
JavaScript
31 lines
25 KiB
JavaScript
|
import{_ as i,c as a,a2 as e,o as t}from"./chunks/framework.C9NVOr0y.js";const g=JSON.parse('{"title":"Versions","description":"","frontmatter":{},"headers":[],"relativePath":"manage/versions.md","filePath":"manage/versions.md","lastUpdated":1687069487000}'),n={name:"manage/versions.md"};function l(h,s,p,k,r,d){return t(),a("div",null,s[0]||(s[0]=[e(`<h1 id="versions" tabindex="-1">Versions <a class="header-anchor" href="#versions" aria-label="Permalink to "Versions""></a></h1><h2 id="install-version" tabindex="-1">Install Version <a class="header-anchor" href="#install-version" aria-label="Permalink to "Install Version""></a></h2><div class="language-shell vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">asdf</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> install</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> <</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">nam</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">e</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">></span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> <</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">versio</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">n</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">></span></span>
|
|||
|
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># asdf install erlang 17.3</span></span></code></pre></div><p>If a plugin supports downloading & compiling from source, you can specify <code>ref:foo</code> where <code>foo</code> is a specific branch, tag, or commit. You'll need to use the same name and reference when uninstalling too.</p><h2 id="install-latest-stable-version" tabindex="-1">Install Latest Stable Version <a class="header-anchor" href="#install-latest-stable-version" aria-label="Permalink to "Install Latest Stable Version""></a></h2><div class="language-shell vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">asdf</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> install</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> <</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">nam</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">e</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">></span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> latest</span></span>
|
|||
|
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># asdf install erlang latest</span></span></code></pre></div><p>Install latest stable version that begins with a given string.</p><div class="language-shell vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">asdf</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> install</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> <</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">nam</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">e</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">></span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> latest:</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"><</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">versio</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">n</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">></span></span>
|
|||
|
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># asdf install erlang latest:17</span></span></code></pre></div><h2 id="list-installed-versions" tabindex="-1">List Installed Versions <a class="header-anchor" href="#list-installed-versions" aria-label="Permalink to "List Installed Versions""></a></h2><div class="language-shell vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">asdf</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> list</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> <</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">nam</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">e</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">></span></span>
|
|||
|
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># asdf list erlang</span></span></code></pre></div><p>Filter versions to those that begin with a given string.</p><div class="language-shell vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">asdf</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> list</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> <</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">nam</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">e</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">></span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> <</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">versio</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">n</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">></span></span>
|
|||
|
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># asdf list erlang 17</span></span></code></pre></div><h2 id="list-all-available-versions" tabindex="-1">List All Available Versions <a class="header-anchor" href="#list-all-available-versions" aria-label="Permalink to "List All Available Versions""></a></h2><div class="language-shell vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">asdf</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> list</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> all</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> <</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">nam</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">e</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">></span></span>
|
|||
|
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># asdf list all erlang</span></span></code></pre></div><p>Filter versions to those that begin with a given string.</p><div class="language-shell vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">asdf</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> list</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> all</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> <</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">nam</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">e</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">></span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> <</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">versio</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">n</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">></span></span>
|
|||
|
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># asdf list all erlang 17</span></span></code></pre></div><h2 id="show-latest-stable-version" tabindex="-1">Show Latest Stable Version <a class="header-anchor" href="#show-latest-stable-version" aria-label="Permalink to "Show Latest Stable Version""></a></h2><div class="language-shell vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">asdf</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> latest</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> <</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">nam</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">e</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">></span></span>
|
|||
|
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># asdf latest erlang</span></span></code></pre></div><p>Show latest stable version that begins with a given string.</p><div class="language-shell vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">asdf</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> latest</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> <</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">nam</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">e</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">></span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> <</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">versio</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">n</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">></span></span>
|
|||
|
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># asdf latest erlang 17</span></span></code></pre></div><h2 id="set-current-version" tabindex="-1">Set Current Version <a class="header-anchor" href="#set-current-version" aria-label="Permalink to "Set Current Version""></a></h2><div class="language-shell vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">asdf</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> global</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> <</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">nam</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">e</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">></span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> <</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">versio</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">n</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> [<version>...]</span></span>
|
|||
|
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">asdf</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> shell</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> <</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">nam</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">e</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">></span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> <</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">versio</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">n</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> [<version>...]</span></span>
|
|||
|
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">asdf</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> local</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> <</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">nam</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">e</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">></span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> <</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">versio</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">n</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> [<version>...]</span></span>
|
|||
|
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># asdf global elixir 1.2.4</span></span>
|
|||
|
<span class="line"></span>
|
|||
|
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">asdf</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> global</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> <</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">nam</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">e</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">></span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> latest[:</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"><</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">versio</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">n</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">></span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">]</span></span>
|
|||
|
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">asdf</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> local</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> <</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">nam</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">e</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">></span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> latest[:</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"><</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">versio</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">n</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">></span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">]</span></span>
|
|||
|
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># asdf global elixir latest</span></span></code></pre></div><p><code>global</code> writes the version to <code>$HOME/.tool-versions</code>.</p><p><code>shell</code> set the version to an environment variable named <code>ASDF_\${TOOL}_VERSION</code>, for the current shell session only.</p><p><code>local</code> writes the version to <code>$PWD/.tool-versions</code>, creating it if needed.</p><p>See the <code>.tool-versions</code> <a href="/manage/configuration.html">file in the Configuration section</a> for details.</p><div class="warning custom-block"><p class="custom-block-title">Alternatively</p><p>If you want to set a version only for the current shell session or for executing just a command under a particular tool version, you can set an environment variable like <code>ASDF_\${TOOL}_VERSION</code>.</p></div><p>The following example runs tests on an Elixir project with version <code>1.4.0</code>. The version format is the same supported by the <code>.tool-versions</code> file.</p><div class="language-shell vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">ASDF_ELIXIR_VERSION</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">1.4.0</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> mix</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> test</span></span></code></pre></div><h2 id="fallback-to-system-version" tabindex="-1">Fallback to System Version <a class="header-anchor" href="#fallback-to-system-version" aria-label="Permalink to "Fallback to System Version""></a></h2><p>To use the system version of tool <code><name></code> instead of an asdf managed version you can set the version for the tool to <code>system</code>.</p><p>Set system with either <code>global</code>, <code>local</code> or <code>shell</code> as outlined in <a href="#set-current-version">Set Current Version</a> section above.</p><div class="language-shell vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">asdf</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> local</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> <</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">nam</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">e</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">></span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> system</span></span>
|
|||
|
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># asdf local python system</span></span></code></pre></div><h2 id="view-current-version" tabindex="-1">View Current Version <a class="header-anchor" href="#view-current-version" aria-label="Permalink to "View Current Version""></a></h2><div class="language-shell vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">asdf</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> current</span></span>
|
|||
|
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># asdf current</span></span>
|
|||
|
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># erlang 17.3 /Users/kim/.tool-versions</span></span>
|
|||
|
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># nodejs 6.11.5 /Users/kim/cool-node-project/.tool-versions</span></span>
|
|||
|
<span class="line"></span>
|
|||
|
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">asdf</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> current</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> <</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">nam</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">e</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">></span></span>
|
|||
|
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># asdf current erlang</span></span>
|
|||
|
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># erlang 17.3 /Users/kim/.tool-versions</span></span></code></pre></div><h2 id="uninstall-version" tabindex="-1">Uninstall Version <a class="header-anchor" href="#uninstall-version" aria-label="Permalink to "Uninstall Version""></a></h2><div class="language-shell vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">asdf</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> uninstall</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> <</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">nam</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">e</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">></span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> <</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">versio</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">n</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">></span></span>
|
|||
|
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># asdf uninstall erlang 17.3</span></span></code></pre></div><h2 id="shims" tabindex="-1">Shims <a class="header-anchor" href="#shims" aria-label="Permalink to "Shims""></a></h2><p>When asdf installs a package it creates shims for every executable program in that package in a <code>$ASDF_DATA_DIR/shims</code> directory (default <code>~/.asdf/shims</code>). This directory being on the <code>$PATH</code> (by means of <code>asdf.sh</code>, <code>asdf.fish</code>, etc) is how the installed programs are made available in the environment.</p><p>The shims themselves are really simple wrappers that <code>exec</code> a helper program <code>asdf exec</code> passing it the name of the plugin and path to the executable in the installed package that the shim is wrapping.</p><p>The <code>asdf exec</code> helper determines the version of the package to use (as specified in <code>.tool-versions</code> file, selected by <code>asdf local ...</code> or <code>asdf global ...</code>), the final path to the executable in the package installation directory (this can be manipulated by the <code>exec-path</code> callback in the plugin) and the environment to execute in (also provided by the plugin - <code>exec-env</code> script), and finally it executes it.</p><div class="warning custom-block"><p class="custom-block-title">Note</p><p>Because this system uses <code>exec</code> calls, any scripts in the package that are meant to be sourced by the shell instead of executed need to be accessed directly instead of via the shim wrapper. The two <code>asdf</code> commands: <code>which</code> and <code>where</code> can help with this by returning the path to the installed package:</p></div><div class="language-shell vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># returns path to main executable in current version</span></span>
|
|||
|
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">source</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> $(</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">asdf</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> which</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> \${PLUGIN})</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">/../script.sh</span></span>
|
|||
|
<span class="line"></span>
|
|||
|
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># returns path to the package installation directory</span></span>
|
|||
|
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">source</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> $(</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">asdf</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> where</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> \${PLUGIN})</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">/bin/script.sh</span></span></code></pre></div><h3 id="by-passing-asdf-shims" tabindex="-1">By-passing asdf shims <a class="header-anchor" href="#by-passing-asdf-shims" aria-label="Permalink to "By-passing asdf shims""></a></h3><p>If for some reason you want to by-pass asdf shims or want your environment variables automatically set upon entering your project's directory, the <a href="https://github.com/asdf-community/asdf-direnv" target="_blank" rel="noreferrer">asdf-direnv</a> plugin can be helpful. Be sure to check its README for more details.</p>`,45)]))}const c=i(n,[["render",l]]);export{g as __pageData,c as default};
|