docs: rewrite using Vuepress (#1000)

This commit is contained in:
James Hegedus 2021-07-23 15:26:21 +10:00 committed by GitHub
parent ccf76dd7e6
commit c9df811997
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
56 changed files with 7903 additions and 2396 deletions

24
.github/workflows/docs-version.yml vendored Normal file
View File

@ -0,0 +1,24 @@
name: "Docs Version Update"
on:
create:
tags:
- "*"
jobs:
bump-version-in-docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
name: checkout repo
with:
ref: "refs/heads/master"
- run: sed -i "s|^\\(git clone.*--branch \\).*$|\\1v$(cat version.txt)|" docs/guide/getting-started.md
name: replace version in docs
- uses: stefanzweifel/git-auto-commit-action@v4
name: commit docs version update
with:
commit_message: "docs: update version in install instructions"

View File

@ -1,24 +1,59 @@
name: Docs name: Docs
on: on:
create: # trigger deployment on every push to main branch
tags: push:
- "*" paths:
- "docs/**"
branches:
- master
# trigger deployment manually
workflow_dispatch:
jobs: jobs:
bump-version-in-docs: docs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
defaults:
run:
working-directory: docs/
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
name: checkout repo
with: with:
ref: "refs/heads/master" # fetch all commits to get last updated time or other git log info
fetch-depth: 0
- run: sed -i "s|^\\(git clone.*--branch \\).*$|\\1v$(cat version.txt)|" docs/core-manage-asdf.md - name: Setup Node.js
name: replace version in docs uses: actions/setup-node@v1
- uses: stefanzweifel/git-auto-commit-action@v4
name: commit docs version update
with: with:
commit_message: "docs: update version in install instructions" node-version: "16"
- name: Cache dependencies
uses: actions/cache@v2
id: npm-cache
with:
path: |
**/node_modules
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-npm-
- name: Install dependencies
if: steps.npm-cache.outputs.cache-hit != 'true'
run: npm install
- name: Build VuePress site
run: npm run build
- name: Bundle CNAME with site dist
run: cp docs/CNAME docs/.vuepress/dist
- name: Deploy to GitHub Pages
uses: crazy-max/ghaction-github-pages@v2
with:
# deploy to gh-pages branch
target_branch: gh-pages
# deploy the default output dir of VuePress
build_dir: docs/.vuepress/dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@ -1,43 +1,39 @@
# How to Contribute to asdf # How to Contribute to asdf
## Did you find a bug? There are many ways to contribute to `asdf`, thanks for taking the time to read and help.
**Ensure the bug is actually an issue with asdf and not a plugin.** If the bug ## `asdf` Core
only occurs when using one tool installed by asdf and not others it's likely an
issue with the asdf plugin. Find the plugin repository on
[asdf-vm/asdf-plugins](https://github.com/asdf-vm/asdf-plugins) and follow the
plugin creators instructions for reporting the bug.
**Ensure the bug was not already reported** by searching on GitHub under ### Did you find a bug?
[Issues](https://github.com/asdf-vm/asdf/issues).
If you are unable to find an open issue addressing the problem please [open Ensure the bug is actually an issue with asdf and not a plugin. If the bug only occurs when using one tool installed by `asdf` and not others it is likely an issue with the **plugin**. Find the plugin repo URL with `asdf plugin list --urls`, browse their repo Issues and if no solution is found open a new Issue there.
a new one](https://github.com/asdf-vm/asdf/issues/new). Please be as specific
as possible when reporting the issue. Include the observed behavior as well as
what you thought should have happened. Please also provide environmental
details like asdf version, shell, OS, etc...
## Did you write a patch that fixes a bug? Ensure the bug was not already reported in existing [Issues](https://github.com/asdf-vm/asdf/issues). If not, then please [open a new Issue](https://github.com/asdf-vm/asdf/issues/new/choose). Please be as specific as possible when reporting the issue.
Open a new GitHub pull request with the patch. Refer to the [Development ### New Features/Proposals
section of the README](http://asdf-vm.github.io/asdf/#/contributing-core-asdf) for the
details on how to run the unit tests. Please make sure that unit tests pass on
Travis CI.
Pull request must contain changes that add new features, fix bugs, or fix Please [open a new Feature Request](https://github.com/asdf-vm/asdf/issues/new/choose) to discuss the feature before implementing a solution.
incorrect documentation. Unsolicited pull requests that only contain formatting
changes like indentation, or line length, or letter case will be rejected.
## Did you create a plugin for asdf? ### Developing with the Core
Please read the [creating plugins](docs/plugins-create.md) guide. See [docs/contribute/core.md](docs/contribute/core.md) or on our [Docs Site](https://asdf-vm.com/contribute/core.html).
## Do you want to contribute the asdf documentation? ## Documentation
Documentation can always be improved! Right now there is just the Documentation can always be improved! See [docs/contribute/documentation.md](docs/contribute/documentation.md) or on our [Docs Site](https://asdf-vm.com/contribute/documentation.html).
[README](README.md) and the [creating plugins](docs/creating-plugins.md) guide.
The [wiki](https://github.com/asdf-vm/asdf/wiki) exists but is in a state of ## First-Party Plugins
disrepair. If you see something that can be improved please submit a pull
request or edit the wiki. We always need help to maintain our plugins. See [docs/contribute/first-party-plugins.md](docs/contribute/first-party-plugins.md) or on our [Docs Site](https://asdf-vm.com/contribute/first-party-plugins.html).
## Create a Plugin?
Please read the [docs/plugins/create.md](docs/plugins/create.md) or on our [Docs Site](https://asdf-vm.com/plugins/create.html).
## GitHub Action
See the [asdf actions repo](https://github.com/asdf-vm/actions) for existing Issues, conversations and Contributing Guidelines.
---
Thanks for contributing! Thanks for contributing!

View File

@ -19,10 +19,10 @@ asdf is a CLI tool that can manage multiple language runtime versions on a per-p
[Please head over to the documentation site for more information](https://asdf-vm.github.io/asdf/)! [Please head over to the documentation site for more information](https://asdf-vm.github.io/asdf/)!
- [Getting Started](https://asdf-vm.github.io/asdf/#/core-manage-asdf) - [Getting Started](https://asdf-vm.github.io/asdf/guide/getting-started.html)
- [All Commands](https://asdf-vm.github.io/asdf/#/core-commands) - [All Commands](https://asdf-vm.github.io/asdf/manage/commands.html)
- [All Plugins](https://asdf-vm.github.io/asdf/#/plugins-all) - [All Plugins](https://github.com/asdf-vm/asdf-plugins)
- [Create a Plugin](https://asdf-vm.github.io/asdf/#/plugins-create) with our [asdf-plugin-template](https://github.com/asdf-vm/asdf-plugin-template) - [Create a Plugin](https://asdf-vm.github.io/asdf/plugins/create.html) with our [asdf-plugin-template](https://github.com/asdf-vm/asdf-plugin-template)
- [asdf GitHub Actions](https://github.com/asdf-vm/actions) - [asdf GitHub Actions](https://github.com/asdf-vm/actions)
## Contributing ## Contributing
@ -31,6 +31,45 @@ See [CONTRIBUTING.md in the repo](https://github.com/asdf-vm/asdf/blob/master/CO
## Community & Questions ## Community & Questions
- [FAQ](https://asdf-vm.github.io/asdf/learn-more/faq.html)
- [![GitHub Issues](https://icongr.am/simple/github.svg?color=808080&size=16) GitHub Issues](https://github.com/asdf-vm/asdf/issues): report a bug or raise a feature request to the `asdf` core team - [![GitHub Issues](https://icongr.am/simple/github.svg?color=808080&size=16) GitHub Issues](https://github.com/asdf-vm/asdf/issues): report a bug or raise a feature request to the `asdf` core team
- [![GitHub Discussions](https://icongr.am/simple/github.svg?color=808080&size=16) GitHub Discussions](https://github.com/asdf-vm/asdf/discussions): our preferred method for community Q&A and interaction - [![GitHub Discussions](https://icongr.am/simple/github.svg?color=808080&size=16) GitHub Discussions](https://github.com/asdf-vm/asdf/discussions): our preferred method for community Q&A and interaction
- [![StackOverflow Tag](https://icongr.am/fontawesome/stack-overflow.svg?size=16&color=808080) StackOverflow Tag](https://stackoverflow.com/questions/tagged/asdf-vm): see existing Q&A for `asdf`. Some of the core team watch this tag in addition to our helpful community - [![StackOverflow Tag](https://icongr.am/fontawesome/stack-overflow.svg?size=16&color=808080) StackOverflow Tag](https://stackoverflow.com/questions/tagged/asdf-vm): see existing Q&A for `asdf`. Some of the core team watch this tag in addition to our helpful community
## Ballad of asdf
> Once upon a time there was a programming language<br/>
> There were many versions of it<br/>
> So people wrote a version manager for it<br/>
> To switch between versions for projects<br/>
> Different, old, new.
> Then there came more programming languages<br/>
> So there came more version managers<br/>
> And many commands for them
> I installed a lot of them<br/>
> I learnt a lot of commands
> Then I said, just one more version manager<br/>
> Which I will write instead
> So, there came another version manager<br/>
> **asdf version manager** - <https://github.com/asdf-vm/asdf>
> A version manager so extendable<br/>
> for which anyone can create a plugin<br/>
> To support their favourite language<br/>
> No more installing more version managers<br/>
> Or learning more commands
---
<figure>
<blockquote>
This was the mail I wrote to a few friends to tell them about the project. Thanks to <a href="https://twitter.com/roshanvid" target="_blank" rel="noreferrer">@roshanvid</a> for suggesting that this go into the readme
</blockquote>
<figcaption>
<a href="https://github.com/HashNuke" target="_blank" rel="noreferrer">@HashNuke</a>
</figcaption>
</figure>

199
docs/.gitattributes vendored Normal file
View File

@ -0,0 +1,199 @@
## GITATTRIBUTES FOR WEB PROJECTS
#
# These settings are for any web project.
#
# Details per file setting:
# text These files should be normalized (i.e. convert CRLF to LF).
# binary These files are binary and should be left untouched.
#
# Note that binary is a macro for -text -diff.
######################################################################
# Auto detect
## Handle line endings automatically for files detected as
## text and leave all files detected as binary untouched.
## This will handle all files NOT defined below.
* text=auto
# Source code
*.bash text eol=lf
*.bat text eol=crlf
*.cmd text eol=crlf
*.coffee text
*.css text
*.htm text diff=html
*.html text diff=html
*.inc text
*.ini text
*.js text
*.json text
*.jsx text
*.less text
*.ls text
*.map text -diff
*.od text
*.onlydata text
*.php text diff=php
*.pl text
*.ps1 text eol=crlf
*.py text diff=python
*.rb text diff=ruby
*.sass text
*.scm text
*.scss text diff=css
*.sh text eol=lf
*.sql text
*.styl text
*.tag text
*.ts text
*.tsx text
*.xml text
*.xhtml text diff=html
# Docker
Dockerfile text
# Documentation
*.ipynb text
*.markdown text
*.md text
*.mdwn text
*.mdown text
*.mkd text
*.mkdn text
*.mdtxt text
*.mdtext text
*.txt text
AUTHORS text
CHANGELOG text
CHANGES text
CONTRIBUTING text
COPYING text
copyright text
*COPYRIGHT* text
INSTALL text
license text
LICENSE text
NEWS text
readme text
*README* text
TODO text
# Templates
*.dot text
*.ejs text
*.haml text
*.handlebars text
*.hbs text
*.hbt text
*.jade text
*.latte text
*.mustache text
*.njk text
*.phtml text
*.tmpl text
*.tpl text
*.twig text
*.vue text
# Configs
*.cnf text
*.conf text
*.config text
.editorconfig text
.env text
.gitattributes text
.gitconfig text
.htaccess text
*.lock text -diff
package-lock.json text -diff
*.toml text
*.yaml text
*.yml text
browserslist text
Makefile text
makefile text
# Heroku
Procfile text
# Graphics
*.ai binary
*.bmp binary
*.eps binary
*.gif binary
*.gifv binary
*.ico binary
*.jng binary
*.jp2 binary
*.jpg binary
*.jpeg binary
*.jpx binary
*.jxr binary
*.pdf binary
*.png binary
*.psb binary
*.psd binary
# SVG treated as an asset (binary) by default.
*.svg text
# If you want to treat it as binary,
# use the following line instead.
# *.svg binary
*.svgz binary
*.tif binary
*.tiff binary
*.wbmp binary
*.webp binary
# Audio
*.kar binary
*.m4a binary
*.mid binary
*.midi binary
*.mp3 binary
*.ogg binary
*.ra binary
# Video
*.3gpp binary
*.3gp binary
*.as binary
*.asf binary
*.asx binary
*.fla binary
*.flv binary
*.m4v binary
*.mng binary
*.mov binary
*.mp4 binary
*.mpeg binary
*.mpg binary
*.ogv binary
*.swc binary
*.swf binary
*.webm binary
# Archives
*.7z binary
*.gz binary
*.jar binary
*.rar binary
*.tar binary
*.zip binary
# Fonts
*.ttf binary
*.eot binary
*.otf binary
*.woff binary
*.woff2 binary
# Executables
*.exe binary
*.pyc binary
# RC files (like .babelrc or .eslintrc)
*.*rc text
# Ignore files (like .npmignore or .gitignore)
*.*ignore text

126
docs/.gitignore vendored Normal file
View File

@ -0,0 +1,126 @@
# Created by https://www.toptal.com/developers/gitignore/api/node
# Edit at https://www.toptal.com/developers/gitignore?templates=node
### Node ###
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*
# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
# Runtime data
pids
*.pid
*.seed
*.pid.lock
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
# Coverage directory used by tools like istanbul
coverage
*.lcov
# nyc test coverage
.nyc_output
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# Bower dependency directory (https://bower.io/)
bower_components
# node-waf configuration
.lock-wscript
# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release
# Dependency directories
node_modules/
jspm_packages/
# Snowpack dependency directory (https://snowpack.dev/)
web_modules/
# TypeScript cache
*.tsbuildinfo
# Optional npm cache directory
.npm
# Optional eslint cache
.eslintcache
# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/
# Optional REPL history
.node_repl_history
# Output of 'npm pack'
*.tgz
# Yarn Integrity file
.yarn-integrity
# dotenv environment variables file
.env
.env.test
.env.production
# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache
# Next.js build output
.next
out
# Nuxt.js build / generate output
.nuxt
dist
# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public
# vuepress build output
.vuepress/.cache
.vuepress/.temp
# Serverless directories
.serverless/
# FuseBox cache
.fusebox/
# DynamoDB Local files
.dynamodb/
# TernJS port file
.tern-port
# Stores VSCode versions used for testing VSCode extensions
.vscode-test
# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*
# End of https://www.toptal.com/developers/gitignore/api/node

View File

1
docs/.tool-versions Normal file
View File

@ -0,0 +1 @@
nodejs 16.4.2

55
docs/.vuepress/config.js Normal file
View File

@ -0,0 +1,55 @@
const navbar = require("./navbar");
const sidebar = require("./sidebar");
module.exports = {
base: "/",
head: [],
locales: {
"/": {
lang: "en-US",
title: "asdf",
description: "Manage multiple runtime versions with a single CLI tool"
}
// "/pt-BR/": {
// lang: "pt-BR",
// title: "asdf",
// description: "TODO: translate"
// }
},
themeConfig: {
// logo: "https://vuejs.org/images/logo.png",
repo: "asdf-vm/asdf",
docsBranch: "master",
docsDir: "docs",
locales: {
"/": {
selectLanguageName: "English",
sidebar: sidebar.en,
navbar: navbar.en
}
// "/pt-BR/": {
// selectLanguageName: "Brazilian Portuguese",
// sidebar: sidebar.pt_br,
// navbar: navbar.pt_br
// }
}
},
plugins: [
[
"@vuepress/plugin-search",
{
locales: {
"/": {
placeholder: "Search"
}
// "/pt-BR/": {
// placeholder: "Search"
// }
}
}
],
["@vuepress/plugin-shiki", { theme: "monokai" }]
]
};

138
docs/.vuepress/navbar.js Normal file
View File

@ -0,0 +1,138 @@
const en = [
{
text: "Getting Started",
link: "/guide/getting-started.html",
activeMatch: "/guide/"
},
{
text: "Reference",
children: [
{
text: "Manage",
children: [
"/manage/core.md",
"/manage/plugins.md",
"/manage/versions.md",
"/manage/configuration.md",
"/manage/commands.md",
{
text: "Changelog",
link: "https://github.com/asdf-vm/asdf/blob/master/CHANGELOG.md"
}
]
}
]
},
{
text: "Plugins",
children: [
{
text: "Author",
children: [
"/plugins/create.md",
{
text: "GitHub Plugin Template",
link: "https://github.com/asdf-vm/asdf-plugin-template"
}
]
},
{
text: "First Party Plugins",
children: [
{
text: "Elixir",
link: "https://github.com/asdf-vm/asdf-elixir"
},
{
text: "Erlang",
link: "https://github.com/asdf-vm/asdf-erlang"
},
{
text: "Node.js",
link: "https://github.com/asdf-vm/asdf-nodejs"
},
{
text: "Ruby",
link: "https://github.com/asdf-vm/asdf-ruby"
}
]
},
{
text: "Community Plugins",
children: [
{
text: "asdf-community",
link: "https://github.com/asdf-community"
},
{
text: "GitHub Topics Search",
link: "https://github.com/topics/asdf-plugin"
}
]
},
{
text: "Reference",
children: [
{
text: "Plugin Shortname Index",
link: "https://github.com/asdf-vm/asdf-plugins"
}
]
}
]
},
{
text: "Contribute",
children: [
{
text: "Core",
children: ["/contribute/core.md", "/contribute/documentation.md"]
},
{
text: "Plugins",
children: ["/contribute/first-party-plugins.md"]
},
{
text: "CICD",
children: ["/contribute/github-actions.md"]
}
]
},
{
text: "Learn More",
children: [
{
text: "Questions",
children: [
"/learn-more/faq.md",
{
text: "GitHub Issues",
link: "https://github.com/asdf-vm/asdf/issues"
},
{
text: "GitHub Discussions",
link: "https://github.com/asdf-vm/asdf/discussions"
},
{
text: "StackOverflow Tag",
link: "https://stackoverflow.com/questions/tagged/asdf-vm"
}
]
},
{
text: "Resources",
children: ["/learn-more/thanks.md"]
}
]
}
];
const pt_br = [
{
text: "Getting Started",
link: "/pt-BR/guide/getting-started.html",
activeMatch: "/pt-BR/guide/"
}
];
module.exports = { en, pt_br };

115
docs/.vuepress/sidebar.js Normal file
View File

@ -0,0 +1,115 @@
const en = {
"/guide/": ["/guide/introduction.md", "/guide/getting-started.md"],
"/manage/": [
{
text: "Manage",
children: [
"/manage/core.md",
"/manage/plugins.md",
"/manage/versions.md",
"/manage/configuration.md",
"/manage/commands.md",
{
text: "Changelog",
link: "https://github.com/asdf-vm/asdf/blob/master/CHANGELOG.md"
}
]
}
],
"/plugins/": [
{
text: "Author",
children: [
"/plugins/create.md",
{
text: "GitHub Plugin Template",
link: "https://github.com/asdf-vm/asdf-plugin-template"
}
]
},
{
text: "First Party Plugins",
children: [
{
text: "Elixir",
link: "https://github.com/asdf-vm/asdf-elixir"
},
{
text: "Erlang",
link: "https://github.com/asdf-vm/asdf-erlang"
},
{
text: "Node.js",
link: "https://github.com/asdf-vm/asdf-nodejs"
},
{
text: "Ruby",
link: "https://github.com/asdf-vm/asdf-ruby"
}
]
},
{
text: "Community Plugins",
children: [
{
text: "asdf-community",
link: "https://github.com/asdf-community/"
}
]
},
{
text: "Reference",
children: [
{
text: "Plugin Shortname Index",
link: "https://github.com/asdf-vm/asdf-plugins"
}
]
}
],
"/contribute/": [
{
text: "Contribute",
children: [
"/contribute/core.md",
"/contribute/documentation.md",
"/contribute/first-party-plugins.md",
"/contribute/github-actions.md"
]
}
],
"/learn-more/": [
{
text: "Questions",
children: [
"/learn-more/faq.md",
{
text: "GitHub Issues",
link: "https://github.com/asdf-vm/asdf/issues"
},
{
text: "GitHub Discussions",
link: "https://github.com/asdf-vm/asdf/discussions"
},
{
text: "StackOverflow Tag",
link: "https://stackoverflow.com/questions/tagged/asdf-vm"
}
]
},
{
text: "Resources",
children: ["/learn-more/thanks.md"]
}
]
};
const pt_br = {
"/pt-BR/guide/": [
"/pt-BR/guide/introduction.md",
"/pt-BR/guide/getting-started.md"
]
};
module.exports = { en, pt_br };

View File

@ -0,0 +1,17 @@
:root {
scroll-behavior: smooth;
--c-brand: #b744b8;
--c-brand-light: #a379c9;
// tip container
--c-tip: #0070f3;
--c-tip-bg: #e3eeff;
--c-tip-title: #004bad;
--c-tip-text: #002974;
}
html.dark {
--c-brand: #b744b8;
--c-brand-light: #a379c9;
// tip container
--c-tip: #31558a;
}

View File

@ -1,7 +0,0 @@
<!-- asdf homepage -->
<!-- include the repo readme -->
[](https://raw.githubusercontent.com/asdf-vm/asdf/master/README.md ':include')
<!-- include the ballad of asdf -->
[](https://raw.githubusercontent.com/asdf-vm/asdf/master/ballad-of-asdf.md ':include')

View File

@ -1,13 +0,0 @@
<h2 align="center">404</h2>
<div style="text-align:center">
Woops! It seems we're lost! :sweat_smile:
Let's [go home](/) and try again.
If we end up lost again, [yell out for some help](https://github.com/asdf-vm/asdf/issues/new) :mega:
If you are here because of a missing section or translation, please [think of contributing](contributing-doc-site) :two_hearts:
</div>

View File

@ -1,14 +0,0 @@
<!-- ![logo](_media.asdf-logo.svg) -->
# asdf
> Manage multiple runtime versions with a single CLI tool
<!-- insert asciinema or other gif here -->
- Bash, Zsh, Fish
- Node.js, Ruby, Python, Elixir ... [your favourite language?](plugins-all?id=plugin-list)
- Extend with a simple plugin system
[GitHub](https://github.com/asdf-vm/asdf)
[Get Started](core-manage-asdf)

View File

@ -1,4 +0,0 @@
- Translations
- [:uk: English](/)
- [:brazil: Português](/pt-br/)
- [Add translation](contributing-doc-site?id=translations)

View File

@ -1,20 +0,0 @@
<!-- docs/_sidebar.md -->
- **Core**
- [Manage asdf](core-manage-asdf)
- [Manage Plugins](core-manage-plugins)
- [Manage Versions](core-manage-versions)
- [Configuration](core-configuration)
- [All Commands](core-commands)
- [Changelog](changelog) <!-- pulls in changelog from repo -->
- **Plugins**
- [Creating Plugins](plugins-create)
- [All Plugins](plugins-all) <!-- pulls in asdf-vm/asdf-plugins readme -->
- **Contributing**
- [Core asdf](contributing-core-asdf)
- [Documentation Site](contributing-doc-site)
- [Thanks](thanks)
- **Community & Questions**
- [![GitHub Issues](https://icongr.am/simple/github.svg?color=808080&size=16) GitHub Issues](https://github.com/asdf-vm/asdf/issues)
- [![GitHub Discussions](https://icongr.am/simple/github.svg?color=808080&size=16) GitHub Discussions](https://github.com/asdf-vm/asdf/discussions)
- [![StackOverflow Tag](https://icongr.am/fontawesome/stack-overflow.svg?size=16&color=808080) StackOverflow Tag](https://stackoverflow.com/questions/tagged/asdf-vm)

113
docs/contribute/core.md Normal file
View File

@ -0,0 +1,113 @@
# asdf
`asdf` core contribution guide.
## Initial Setup
Fork `asdf` on GitHub and/or Git clone the default branch:
```shell:no-line-numbers
# clone your fork
git clone https://github.com/<GITHUB_USER>/asdf.git
# or clone asdf
git clone https://github.com/asdf-vm/asdf.git
```
The tools for core development are in this repo's `.tool-versions`. If you wish to manage with `asdf` itself, add the plugins:
```shell:no-line-numbers
asdf plugin add bats https://github.com/timgluz/asdf-bats.git
asdf plugin add shellcheck https://github.com/luizm/asdf-shellcheck.git
asdf plugin add shfmt https://github.com/luizm/asdf-shfmt.git
```
Install the versions to develop `asdf` with:
```shell:no-line-numbers
asdf install
```
It *may* be useful to not use `asdf` to manage the tools during development on your local machine as you may need to break functionality which would then break your dev tooling. Here's the raw list of tools:
- [bats-core](https://github.com/bats-core/bats-core): Bash Automated Testing System, for unit testing Bash or POSIX compliant scripts.
- [shellcheck](https://github.com/koalaman/shellcheck): Static analysis tool for shell scripts.
- [shfmt](https://github.com/mvdan/sh): A shell parser, formatter, and interpreter with bash support; includes shfmt
## Development
If you want to try out your changes without making change to your installed `asdf`, you can set the `$ASDF_DIR` variable to the path where you cloned the repository, and temporarily prepend the `bin` and `shims` directory of the directory to your path.
It is best to format, lint and test your code locally before you commit or push to the remote. Use the following scripts/commands:
```shell:no-line-numbers
# Shellcheck
./scripts/shellcheck.bash
# Format
./scripts/shfmt.bash
# Test: all tests
bats test/
# Test: for specific command
bats test/list_commands.bash
```
::: tip
**Add tests!** - Tests are **required** for new features and speed up review of bug fixes. Please cover new code paths before you create a Pull Request. See [bats-core documentation](https://bats-core.readthedocs.io/en/stable/index.html)
:::
## Bats Testing
It is **strongly encouraged** to examine the existing test suite and the [bats-core documentation](https://bats-core.readthedocs.io/en/stable/index.html) before writing tests.
Bats debugging can be difficult at times. Using the TAP output with `-t` flag will enable you to print outputs with the special file descriptor `>&3` during test execution, simplifying debugging. As an example:
```shell
# test/some_tests.bats
printf "%s\n" "Will not be printed during bats test/some_tests.bats"
printf "%s\n" "Will be printed during bats -t test/some_tests.bats" >&3
```
This is further documented in bats-core [Printing to the Terminal](https://bats-core.readthedocs.io/en/stable/writing-tests.html#printing-to-the-terminal).
## Pull Requests, Releases & Conventional Commits
`asdf` is using an automated release tool called [Release Please](https://github.com/googleapis/release-please) to automatically bump the [SemVer](https://semver.org/) version and generate the [Changelog](https://github.com/asdf-vm/asdf/blob/master/CHANGELOG.md). This information is determined by reading the commit history since the last release.
[Conventional Commit messages](https://www.conventionalcommits.org/) define the format of the Pull Request Title which becomes the commit message format on the default branch. This is enforced with GitHub Action [`amannn/action-semantic-pull-request`](https://github.com/amannn/action-semantic-pull-request).
Conventional Commit follows this format:
```:no-line-numbers
<type>[optional scope][optional !]: <description>
<!-- examples -->
fix: some fix
feat: a new feature
docs: some documentation update
docs(website): some change for the website
feat!: feature with breaking change
```
The full list of `<types>` are: `feat`, `fix`, `docs`, `style`, `refactor`, `perf`, `test`, `build`, `ci`, `chore`, `revert`.
The `!` indicates a breaking change.
`fix`: will create a new SemVer `patch`
`feat`: will create a new SemVer `minor`
`<type>!`: will create a new SemVer `major`
The Pull Request Title must follow this format.
::: tip
Use Conventional Commit message format for your Pull Request Title.
:::
## Docker Images
The [asdf-alpine](https://github.com/vic/asdf-alpine) and [asdf-ubuntu](https://github.com/vic/asdf-ubuntu) projects are an ongoing effort to provide Dockerized images of some asdf tools. You can use these docker images as base for your development servers, or for running your production apps.

View File

@ -0,0 +1,119 @@
# Docs & Site
Documentation & site contribution guide.
## Initial Setup
Fork `asdf` on GitHub and/or Git clone the default branch:
```shell:no-line-numbers
# clone your fork
git clone https://github.com/<GITHUB_USER>/asdf.git
# or clone asdf
git clone https://github.com/asdf-vm/asdf.git
```
The tools for Docs site development are managed with `asdf` in the `docs/.tool-versions`. Add the plugins with:
```shell:no-line-numbers
asdf plugin add nodejs https://github.com/asdf-vm/asdf-nodejs
```
Install the tool version(s) with:
```shell:no-line-numbers
asdf install
```
- [Node.js](https://nodejs.org): JavaScript runtime built on Chrome's V8 JavaScript engine.
Install Node.js dependencies from `docs/package.json`:
```shell:no-line-numbers
npm install
```
## Development
[Vuepress (v2)](https://v2.vuepress.vuejs.org/) is the Static Site Generator (SSG) we use to build the asdf documentation site. It was chosen to replace [Docsify.js](https://docsify.js.org/) as we would like to support an HTML only fallback when users do not have JavaScript available or enabled. This was not possible with Docsify. Other than this, the feature-set is largely the same, with the focus on writing Markdown files with minimal configuration.
`package.json` contains the scripts required for development:
@[code json{3-5}](../package.json)
To start the local development server:
```shell:no-line-numbers
npm run dev
```
Format the code before committing:
```shell:no-line-numbers
npm run format
```
## Pull Requests, Releases & Conventional Commits
`asdf` is using an automated release pipeline which relies on Conventional Commits in PR titles. Detailed documentation found in the [core contribution guide](./core.md).
When creating a PR for documentation changes please make the PR title with the Conventional Commit type `docs` in the format `docs: <description>`.
## Vuepress
Configuration of the site is contained within a few JavaScript files with JS Objects used to represent the config. They are:
- `docs/.vuepress/config.js`: the root config file for the site. Read the [Vuepress documentation](https://v2.vuepress.vuejs.org/guide/configuration.html#config-file) for it's spec.
To simplify the root config, the larger JS Objects representing the _navbar_ and _sidebar_ configuration have been extracted and separated by their locale. See both in:
- `docs/.vuepress/navbar.js`
- `docs/.vuepress/sidebar.js`
With the official documentation for these configs living in the [Default Theme Reference](https://v2.vuepress.vuejs.org/reference/default-theme/config.html#locale-config).
## I18n
Vuepress has first-class support for internationalization. The
root config `docs/.vuepress/config.js` defines the supported locales with their URL, title in the selection dropdown menu and navbar/sidebar configs references.
The navbar/sidebar configs are captured in the aforementioned config files, separated by locale and exported individually.
The markdown content for each locale must fall under a folder with the same name as the keys for `locales` in the root config. That is:
```js
{
...
themeConfig: {
locales: {
"/": {
selectLanguageName: "English (US)",
sidebar: sidebar.en,
navbar: navbar.en
},
"/pt-BR/": {
selectLanguageName: "Brazilian Portuguese",
sidebar: sidebar.pt_br,
navbar: navbar.pt_br
}
}
}
}
```
`/pt-BR/` will require the same set of markdown files located under `docs/pt-BR/`, like so:
```shell:no-line-numbers
docs
├─ README.md
├─ foo.md
├─ nested
│ └─ README.md
└─ pt-BR
├─ README.md
├─ foo.md
└─ nested
└─ README.md
```
The [official Vuepress i18n documentation](https://v2.vuepress.vuejs.org/guide/i18n.html#site-i18n-config) goes into more detail.

View File

@ -0,0 +1,14 @@
# First-Party Plugins
The asdf core team has authored some plugins relevant to their daily work life. Help is always welcome in maintaining and improving these plugins. See the associated repo for each linked below:
- [Elixir](https://github.com/asdf-vm/asdf-elixir)
- [Erlang](https://github.com/asdf-vm/asdf-erlang)
- [Node.js](https://github.com/asdf-vm/asdf-nodejs)
- [Ruby](https://github.com/asdf-vm/asdf-ruby)
For community plugins, see:
- [`asdf-community` organisation](https://github.com/asdf-community): A collaborative, community-driven project for long-term maintenance of `asdf` plugins.
- [`asdf-plugins` shortname repo](https://github.com/asdf-vm/asdf-plugins): Short-name list used by `asdf` core to lookup popular `asdf` plugins.
- [GitHub `asdf-plugin` topic search](https://github.com/topics/asdf-plugin)

View File

@ -0,0 +1,3 @@
# GitHub Actions
Thanks for your interest, please see the [asdf actions repo](https://github.com/asdf-vm/actions) for their existing Issues, conversations and Contributing Guidelines.

View File

@ -1,21 +0,0 @@
## Development
To develop the project, simply `git clone` the master branch.
If you want to try out your changes without making change to your installed `asdf`, you can set the `$ASDF_DIR` variable to the path where you cloned the repository, and temporarily prepend the `bin` and `shims` directory of the directory to your path.
Tools we use:
- [bats](https://github.com/bats-core/bats-core) for testing. Make sure
`bats test/` passes after you made your changes.
- [Shellcheck](https://github.com/koalaman/shellcheck) for static analysis of our shell scripts.
## Docker Images
The [asdf-alpine][asdf-alpine] and [asdf-ubuntu][asdf-ubuntu] projects are an
ongoing effort to provide Dockerized images of some asdf tools. You can use
these docker images as base for your development servers, or for running your
production apps.
[asdf-alpine]: https://github.com/vic/asdf-alpine
[asdf-ubuntu]: https://github.com/vic/asdf-ubuntu

View File

@ -1,69 +0,0 @@
## Improvements
Here is a list of improvements we are looking at making to the documentation. If you wish to contribute, try something out here:
- customise the docsify theme
- cover-page background image
- cover-page/readme gif of a terminal using asdf showing it's features (automatic version switching, .tool-versions with multiple runtime configs)
- custom doc site domain
- change the typography
- get a logo?
- improve "edit on GitHub" button/link
- add asdf to awesome-docsify showcase
## Setup Your Environment
We're using:
- [Node.js](https://github.com/asdf-vm/asdf-nodejs) `v10.15.0` to support the other required tools
- [docsify](https://docsify.js.org/#/) to create our documentation site
- [prettier](https://prettier.io/) to format our markdown files
### Install Dependencies
We are trying to **avoid polluting** the core repo with tooling for this documentation site. As such, it would be great if you could install these development tools **globally** so we don't need to commit them to this project.
```shell
npm i docsify-cli prettier -g
```
## Serve the Site
From the root of this repo run:
```shell
docsify serve docs
```
## Format before Committing
From the root of this repo run:
```shell
prettier --write "docs/**/*.md"
```
## Translations
It would be great to provide translations for other languages.
Docsify makes adding new languages quite easy. Look in `docs/index.html` for commented out `zh-cn` examples.
### Adding a new Translation
1. create a folder in `docs/` for the new translation
```
docs/
docs/zh-cn/
```
2. copy file from root `docs/_404.md` to new folder `docs/zh-cn/_404.md`
```
docs/_404.md
docs/zh-cn/_404.md
```
3. replace text with translated text.
4. repeat for all files.
5. add a link to the new translation in `_navbar.md`.
6. run `prettier` before committing.
For more information, see the [Configuration](https://docsify.js.org/#/configuration) docsify docs, the [Custom navbar](https://docsify.js.org/#/custom-navbar) docsify docs, and have a look at their own `index.html`'s [search section](https://github.com/docsifyjs/docsify/blob/6ac7bace213145cb655e9a5e9e209384db08e5f9/docs/index.html#L48).

View File

@ -1,9 +0,0 @@
<!--
single source of truth.
import commands list from master branch of repo.
not amenable to docs supporting git refs. Solution to be determined.
-->
`asdf` or `asdf help` will list all available commands for your current asdf version.
[](https://raw.githubusercontent.com/asdf-vm/asdf/master/help.txt ':include')

View File

@ -1,630 +0,0 @@
1. [Manage asdf](/core-manage-asdf): install `asdf` **and** add `asdf` to your shell
2. [Manage Plugins](/core-manage-plugins): add a plugin for your tool `asdf plugin add nodejs`
3. [Manage Versions](/core-manage-versions): install a version of that tool `asdf install nodejs 13.14.0`
4. [Configuration](/core-configuration): set global and project tool versions via `.tool-versions` config
## Install
### Dependencies
<!-- select:start -->
<!-- select-menu-labels: Operating System,Installation Method -->
#### -- Linux,Aptitude --
```shell
sudo apt install curl git
```
#### -- Linux,DNF --
```shell
sudo dnf install curl git
```
#### -- Linux,Pacman --
```shell
sudo pacman -S curl git
```
#### -- Linux,Zypper --
```shell
sudo zypper install curl git
```
#### -- macOS,Homebrew --
Dependencies will be automatically installed by Homebrew.
#### -- macOS,Spack --
```shell
spack install coreutils curl git
```
### -- Docsify Select Default --
No match for _Operating System_ and _Installation Method_ selections. Please try another combination.
<!-- select:end -->
### asdf
<!-- select:start -->
<!-- select-menu-labels: Installation Method -->
### --Git--
Clone only the latest branch:
```shell
git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.8.1
```
Alternately, you can clone the whole repo and checkout the latest branch:
```shell
git clone https://github.com/asdf-vm/asdf.git ~/.asdf
git -C ~/.asdf checkout "$(git -C ~/.asdf describe --abbrev=0 --tags)"
```
### --Homebrew--
!> See `asdf` and Homebrew compatibility [issues in #785](https://github.com/asdf-vm/asdf/issues/785) before continuing.
Install using the Homebrew package manager:
```shell
brew install asdf
```
To use the latest changes, you can point Homebrew to the master branch of the repo:
```shell
brew install asdf --HEAD
```
### --Pacman--
Install using `pacman`:
```shell
git clone https://aur.archlinux.org/asdf-vm.git
cd asdf-vm
makepkg -si
```
Or use your preferred [AUR helper](https://wiki.archlinux.org/index.php/AUR_helpers)
<!-- select:end -->
### Add to your Shell
<!-- select:start -->
<!-- select-menu-labels: Operating System,Shell,Installation Method -->
#### --Linux,Bash,Git--
Add the following to `~/.bashrc`:
```shell
. $HOME/.asdf/asdf.sh
```
?> Completions must be configured by adding the following to your `.bashrc`:
```shell
. $HOME/.asdf/completions/asdf.bash
```
#### --Linux,Fish,Git--
Add the following to `~/.config/fish/config.fish`:
```shell
source ~/.asdf/asdf.fish
```
?> Completions must be configured manually with the following command:
```shell
mkdir -p ~/.config/fish/completions; and ln -s ~/.asdf/completions/asdf.fish ~/.config/fish/completions
```
#### --Linux,ZSH,Git--
Add the following to `~/.zshrc`:
```shell
. $HOME/.asdf/asdf.sh
```
**OR** use a ZSH Framework plugin like [asdf for oh-my-zsh](https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/asdf) which will source this script and setup completions.
?> Completions are configured by either a ZSH Framework `asdf` plugin or by adding the following to your `.zshrc`:
```shell
# append completions to fpath
fpath=(${ASDF_DIR}/completions $fpath)
# initialise completions with ZSH's compinit
autoload -Uz compinit
compinit
```
- if you are using a custom `compinit` setup, ensure `compinit` is below your sourcing of `asdf.sh`
- if you are using a custom `compinit` setup with a ZSH Framework, ensure `compinit` is below your sourcing of the framework
!> if you are using a ZSH Framework the associated `asdf` plugin may need to be updated to use the new ZSH completions properly via `fpath`. The Oh-My-ZSH asdf plugin is yet to be updated, see https://github.com/ohmyzsh/ohmyzsh/pull/8837.
#### --Linux,Bash,Pacman--
Add the following to `~/.bashrc`:
```shell
. /opt/asdf-vm/asdf.sh
```
?> [`bash-completion` needs to be installed for the completions to work](https://wiki.archlinux.org/title/bash#Common_programs_and_options)
#### --Linux,Fish,Pacman--
Add the following to `~/.config/fish/config.fish`:
```shell
source /opt/asdf-vm/asdf.fish
```
!> Completions are automatically configured on installation by the AUR package.
#### --Linux,ZSH,Pacman--
Add the following to `~/.zshrc`:
```shell
. /opt/asdf-vm/asdf.sh
```
?> Completions are placed in a ZSH friendly location, but [ZSH must be configured to use the autocompletions](https://wiki.archlinux.org/index.php/zsh#Command_completion).
#### --macOS,Bash,Git--
If using **macOS Catalina or newer**, the default shell has changed to **ZSH**. Unless changing back to Bash, follow the ZSH instructions.
Add the following to `~/.bash_profile`:
```shell
. $HOME/.asdf/asdf.sh
```
?> Completions must be configured manually with the following entry in your `.bash_profile`:
```shell
. $HOME/.asdf/completions/asdf.bash
```
#### --macOS,Fish,Git--
Add the following to `~/.config/fish/config.fish`:
```shell
source ~/.asdf/asdf.fish
```
?> Completions must be configured manually with the following command:
```shell
mkdir -p ~/.config/fish/completions; and cp ~/.asdf/completions/asdf.fish ~/.config/fish/completions
```
#### --macOS,ZSH,Git--
Add the following to `~/.zshrc`:
```shell
. $HOME/.asdf/asdf.sh
```
**OR** use a ZSH Framework plugin like [asdf for oh-my-zsh](https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/asdf) which will source this script and setup completions.
?> Completions are configured by either a ZSH Framework `asdf` plugin or by adding the following to your `.zshrc`:
```shell
# append completions to fpath
fpath=(${ASDF_DIR}/completions $fpath)
# initialise completions with ZSH's compinit
autoload -Uz compinit
compinit
```
- if you are using a custom `compinit` setup, ensure `compinit` is below your sourcing of `asdf.sh`
- if you are using a custom `compinit` setup with a ZSH Framework, ensure `compinit` is below your sourcing of the framework
!> if you are using a ZSH Framework the associated `asdf` plugin may need to be updated to use the new ZSH completions properly via `fpath`. The Oh-My-ZSH asdf plugin is yet to be updated, see https://github.com/ohmyzsh/ohmyzsh/pull/8837.
#### --macOS,Bash,Homebrew--
If using **macOS Catalina or newer**, the default shell has changed to **ZSH**. Unless changing back to Bash, follow the ZSH instructions.
Add `asdf.sh` to your `~/.bash_profile` with:
```shell
echo -e "\n. $(brew --prefix asdf)/asdf.sh" >> ~/.bash_profile
```
?> Completions will need to be [configured as per Homebrew's instructions](https://docs.brew.sh/Shell-Completion#configuring-completions-in-bash) or with the following:
```shell
echo -e "\n. $(brew --prefix asdf)/etc/bash_completion.d/asdf.bash" >> ~/.bash_profile
```
#### --macOS,Fish,Homebrew--
Add `asdf.fish` to your `~/.config/fish/config.fish` with:
```shell
echo -e "\nsource "(brew --prefix asdf)"/asdf.fish" >> ~/.config/fish/config.fish
```
?> Completions are [handled by Homebrew for the Fish shell](https://docs.brew.sh/Shell-Completion#configuring-completions-in-fish). Friendly!
#### --macOS,ZSH,Homebrew--
Add `asdf.sh` to your `~/.zshrc` with:
```shell
echo -e "\n. $(brew --prefix asdf)/asdf.sh" >> ${ZDOTDIR:-~}/.zshrc
```
**OR** use a ZSH Framework plugin like [asdf for oh-my-zsh](https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/asdf) which will source this script and setup completions.
?> Completions are configured by either a ZSH Framework `asdf` or will need to be [configured as per Homebrew's instructions](https://docs.brew.sh/Shell-Completion#configuring-completions-in-zsh). If you are using a ZSH Framework the associated asdf plugin may need to be updated to use the new ZSH completions properly via fpath. The Oh-My-ZSH asdf plugin is yet to be updated, see [ohmyzsh/ohmyzsh#8837](https://github.com/ohmyzsh/ohmyzsh/pull/8837).
### --Docsify Select Default--
!> The `Homebrew` `asdf` Formulae has not been tested on `Linux` by the core asdf team. Please raise an issue if this has changed and we will update the docs.
<!-- select:end -->
Restart your shell so that PATH changes take effect. (Opening a new terminal
tab will usually do it.)
You are ready to use asdf 🎉
### Having Issues?
If you're having issues with your shell not detecting newly installed shims, it's most-likely due to the sourcing of `asdf.sh` or `asdf.fish` not being at the **BOTTOM** of your `.bash_profile`, `.zshrc`, `config.fish` config file. It needs to be sourced **AFTER** you have set your `$PATH` and **AFTER** you have sourced your framework (oh-my-zsh etc).
### Migrating Tools
If you're migrating from other tools and want to use your existing version files (eg: `.node-version` or `.ruby-version`), look at the `legacy_version_file` [flag in the configuration section](core-configuration?id=homeasdfrc).
## Update
<!-- select:start -->
<!-- select-menu-labels: Installation Method -->
### -- Git --
```shell
asdf update
```
If you want the latest changes that aren't yet included in a stable release:
```shell
asdf update --head
```
### -- Homebrew --
```shell
brew upgrade asdf
```
### -- Pacman --
Manually download a new `PKGBUILD` and rebuild or use your preferred AUR helper.
<!-- select:end -->
## Remove
To uninstall `asdf` follow these steps:
<!-- select:start -->
<!-- select-menu-labels: Operating System,Shell,Installation Method -->
### --Linux,Bash,Git--
1. In your `~/.bashrc` remove the lines that source `asdf.sh` and the completions:
```shell
. $HOME/.asdf/asdf.sh
. $HOME/.asdf/completions/asdf.bash
```
2. Remove the `$HOME/.asdf` dir:
```shell
rm -rf ${ASDF_DATA_DIR:-$HOME/.asdf}
```
3. Run this command to remove all `asdf` config files:
```shell
rm -rf $HOME/.tool-versions $HOME/.asdfrc
```
### --Linux,Fish,Git--
1. In your `~/.config/fish/config.fish` remove the lines that source `asdf.sh`:
```shell
source ~/.asdf/asdf.fish
```
and remove completions with this command:
```shell
rm -rf ~/.config/fish/completions/asdf.fish
```
2. Remove the `$HOME/.asdf` dir:
```shell
rm -rf ${ASDF_DATA_DIR:-$HOME/.asdf}
```
3. Run this command to remove all `asdf` config files:
```shell
rm -rf $HOME/.tool-versions $HOME/.asdfrc
```
### --Linux,ZSH,Git--
1. In your `~/.zshrc` remove the lines that source `asdf.sh` and completions:
```shell
. $HOME/.asdf/asdf.sh
# ...
fpath=(${ASDF_DIR}/completions $fpath)
autoload -Uz compinit
compinit
```
**OR** the ZSH Framework plugin if used.
2. Remove the `$HOME/.asdf` dir:
```shell
rm -rf ${ASDF_DATA_DIR:-$HOME/.asdf}
```
3. Run this command to remove all `asdf` config files:
```shell
rm -rf $HOME/.tool-versions $HOME/.asdfrc
```
### --Linux,Bash,Pacman--
1. In your `~/.bashrc` remove the lines that source `asdf.sh` and the completions:
```shell
. /opt/asdf-vm/asdf.sh
```
2. Uninstall with your package manager:
```shell
pacman -Rs asdf-vm
```
3. Remove the `$HOME/.asdf` dir:
```shell
rm -rf ${ASDF_DATA_DIR:-$HOME/.asdf}
```
4. Run this command to remove all `asdf` config files:
```shell
rm -rf $HOME/.tool-versions $HOME/.asdfrc
```
### --Linux,Fish,Pacman--
1. In your `~/.config/fish/config.fish` remove the lines that source `asdf.fish`:
```shell
source /opt/asdf-vm/asdf.fish
```
2. Uninstall with your package manager:
```shell
pacman -Rs asdf-vm
```
3. Remove the `$HOME/.asdf` dir:
```shell
rm -rf ${ASDF_DATA_DIR:-$HOME/.asdf}
```
4. Run this command to remove all `asdf` config files:
```shell
rm -rf $HOME/.tool-versions $HOME/.asdfrc
```
### --Linux,ZSH,Pacman--
1. In your `~/.zshrc` remove the lines that source `asdf.sh`:
```shell
. /opt/asdf-vm/asdf.sh
```
2. Uninstall with your package manager:
```shell
pacman -Rs asdf-vm
```
3. Remove the `$HOME/.asdf` dir:
```shell
rm -rf ${ASDF_DATA_DIR:-$HOME/.asdf}
```
4. Run this command to remove all `asdf` config files:
```shell
rm -rf $HOME/.tool-versions $HOME/.asdfrc
```
### --macOS,Bash,Git--
1. In your `~/.bash_profile` remove the lines that source `asdf.sh` and the completions:
```shell
. $HOME/.asdf/asdf.sh
. $HOME/.asdf/completions/asdf.bash
```
2. Remove the `$HOME/.asdf` dir:
```shell
rm -rf ${ASDF_DATA_DIR:-$HOME/.asdf}
```
3. Run this command to remove all `asdf` config files:
```shell
rm -rf $HOME/.tool-versions $HOME/.asdfrc
```
### --macOS,Fish,Git--
1. In your `~/.config/fish/config.fish` remove the lines that source `asdf.fish`:
```shell
source ~/.asdf/asdf.fish
```
and remove completions with this command:
```shell
rm -rf ~/.config/fish/completions/asdf.fish
```
2. Remove the `$HOME/.asdf` dir:
```shell
rm -rf ${ASDF_DATA_DIR:-$HOME/.asdf}
```
3. Run this command to remove all `asdf` config files:
```shell
rm -rf $HOME/.tool-versions $HOME/.asdfrc
```
### --macOS,ZSH,Git--
1. In your `~/.zshrc` remove the lines that source `asdf.sh` and completions:
```shell
. $HOME/.asdf/asdf.sh
# ...
fpath=(${ASDF_DIR}/completions $fpath)
autoload -Uz compinit
compinit
```
**OR** the ZSH Framework plugin if used.
2. Remove the `$HOME/.asdf` dir:
```shell
rm -rf ${ASDF_DATA_DIR:-$HOME/.asdf}
```
3. Run this command to remove all `asdf` config files:
```shell
rm -rf $HOME/.tool-versions $HOME/.asdfrc
```
### --macOS,Bash,Homebrew--
If using **macOS Catalina or newer**, the default shell has changed to **ZSH**. If you can't find any config in your `~/.bash_profile` it may be in a `~/.zshrc` in which case please follow the ZSH instructions.
1. In your `~/.bash_profile` remove the lines that source `asdf.sh` and the completions:
```shell
. $(brew --prefix asdf)/asdf.sh
. $(brew --prefix asdf)/etc/bash_completion.d/asdf.bash
```
?> Completions may have been [configured as per Homebrew's instructions](https://docs.brew.sh/Shell-Completion#configuring-completions-in-bash) so follow their guide to find out what to remove.
2. Uninstall with your package manager:
```shell
brew uninstall asdf --force
```
3. Run this command to remove all `asdf` config files:
```shell
rm -rf $HOME/.tool-versions $HOME/.asdfrc
```
### --macOS,Fish,Homebrew--
1. In your `~/.config/fish/config.fish` remove the lines that source `asdf.fish`:
```shell
source "(brew --prefix asdf)"/asdf.fish
```
2. Uninstall with your package manager:
```shell
brew uninstall asdf --force
```
3. Run this command to remove all `asdf` config files:
```shell
rm -rf $HOME/.tool-versions $HOME/.asdfrc
```
### --macOS,ZSH,Homebrew--
1. In your `~/.zshrc` remove the lines that source `asdf.sh`:
```shell
. $(brew --prefix asdf)/asdf.sh
```
2. Uninstall with your package manager:
```shell
brew uninstall asdf --force && brew autoremove
```
3. Run this command to remove all `asdf` config files:
```shell
rm -rf $HOME/.tool-versions $HOME/.asdfrc
```
<!-- select:end -->
That's it! 🎉

View File

@ -0,0 +1,295 @@
# Getting Started
`asdf` installation involves:
1. Installing dependencies
2. Installing `asdf` core
3. Adding `asdf` to your shell
4. install a plugin for each tool/runtime you wish to manage
5. install a version of the tool/runtime
6. set global and project versions via `.tool-versions` config files
## 1. Install Dependencies
**Linux**:
| Package Manager | Command |
| --------------- | ------------------------------ |
| Aptitude | `sudo apt install curl git` |
| DNF | `sudo dnf install curl git` |
| Pacman | `sudo pacman -S curl git` |
| Zypper | `sudo zypper install curl git` |
**macOS**:
| Package Manager | Command |
| --------------- | --------------------------------------------------------- |
| Homebrew | Dependencies will be automatically installed by Homebrew. |
| Spack | `spack install coreutils curl git` |
## 2. Install asdf
We recommend installing via Git, though there are other platform specific methods:
| Method | Command |
| -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Git | `git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.8.1` |
| Homebrew | `brew install asdf` |
| Pacman | `git clone https://aur.archlinux.org/asdf-vm.git && cd asdf-vm && makepkg -si` or use your preferred [AUR helper](https://wiki.archlinux.org/index.php/AUR_helpers) |
## 3. Add to your Shell
There are many different combinations of Shells, OSs & Installation methods all of which affect the configuration here. Expand the selection below that best matches your system:
::: details Bash & Git
Add the following to `~/.bashrc`:
```shell
. $HOME/.asdf/asdf.sh
```
Completions must be configured by adding the following to your `.bashrc`:
```shell
. $HOME/.asdf/completions/asdf.bash
```
:::
::: details Bash & Git (macOS)
If using **macOS Catalina or newer**, the default shell has changed to **ZSH**. Unless changing back to Bash, follow the ZSH instructions.
Add the following to `~/.bash_profile`:
```shell
. $HOME/.asdf/asdf.sh
```
Completions must be configured manually with the following entry in your `.bash_profile`:
```shell
. $HOME/.asdf/completions/asdf.bash
```
:::
::: details Bash & Homebrew (macOS)
If using **macOS Catalina or newer**, the default shell has changed to **ZSH**. Unless changing back to Bash, follow the ZSH instructions.
Add `asdf.sh` to your `~/.bash_profile` with:
```shell:no-line-numbers
echo -e "\n. $(brew --prefix asdf)/asdf.sh" >> ~/.bash_profile
```
Completions will need to be [configured as per Homebrew's instructions](https://docs.brew.sh/Shell-Completion#configuring-completions-in-bash) or with the following:
```shell:no-line-numbers
echo -e "\n. $(brew --prefix asdf)/etc/bash_completion.d/asdf.bash" >> ~/.bash_profile
```
:::
::: details Bash & Pacman
Add the following to `~/.bashrc`:
```shell
. /opt/asdf-vm/asdf.sh
```
[`bash-completion`](https://wiki.archlinux.org/title/bash#Common_programs_and_options) needs to be installed for the completions to work.
:::
::: details Fish & Git
Add the following to `~/.config/fish/config.fish`:
```shell
source ~/.asdf/asdf.fish
```
Completions must be configured manually with the following command:
```shell:no-line-numbers
mkdir -p ~/.config/fish/completions; and ln -s ~/.asdf/completions/asdf.fish ~/.config/fish/completions
```
:::
::: details Fish & Homebrew
Add `asdf.fish` to your `~/.config/fish/config.fish` with:
```shell:no-line-numbers
echo -e "\nsource "(brew --prefix asdf)"/asdf.fish" >> ~/.config/fish/config.fish
```
Completions are [handled by Homebrew for the Fish shell](https://docs.brew.sh/Shell-Completion#configuring-completions-in-fish). Friendly!
:::
::: details Fish & Pacman
Add the following to `~/.config/fish/config.fish`:
```shell
source /opt/asdf-vm/asdf.fish
```
Completions are automatically configured on installation by the AUR package.
:::
::: details ZSH & Git
Add the following to `~/.zshrc`:
```shell
. $HOME/.asdf/asdf.sh
```
**OR** use a ZSH Framework plugin like [asdf for oh-my-zsh](https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/asdf) which will source this script and setup completions.
Completions are configured by either a ZSH Framework `asdf` plugin or by adding the following to your `.zshrc`:
```shell
# append completions to fpath
fpath=(${ASDF_DIR}/completions $fpath)
# initialise completions with ZSH's compinit
autoload -Uz compinit && compinit
```
- if you are using a custom `compinit` setup, ensure `compinit` is below your sourcing of `asdf.sh`
- if you are using a custom `compinit` setup with a ZSH Framework, ensure `compinit` is below your sourcing of the framework
**Warning**
If you are using a ZSH Framework the associated `asdf` plugin may need to be updated to use the new ZSH completions properly via `fpath`. The Oh-My-ZSH asdf plugin is yet to be updated, see [ohmyzsh/ohmyzsh#8837](https://github.com/ohmyzsh/ohmyzsh/pull/8837).
:::
::: details ZSH & Homebrew
Add `asdf.sh` to your `~/.zshrc` with:
```shell
echo -e "\n. $(brew --prefix asdf)/asdf.sh" >> ${ZDOTDIR:-~}/.zshrc
```
**OR** use a ZSH Framework plugin like [asdf for oh-my-zsh](https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/asdf) which will source this script and setup completions.
Completions are configured by either a ZSH Framework `asdf` or will need to be [configured as per Homebrew's instructions](https://docs.brew.sh/Shell-Completion#configuring-completions-in-zsh). If you are using a ZSH Framework the associated plugin for asdf may need to be updated to use the new ZSH completions properly via `fpath`. The Oh-My-ZSH asdf plugin is yet to be updated, see [ohmyzsh/ohmyzsh#8837](https://github.com/ohmyzsh/ohmyzsh/pull/8837).
:::
::: details ZSH & Pacman
Add the following to `~/.zshrc`:
```shell
. /opt/asdf-vm/asdf.sh
```
Completions are placed in a ZSH friendly location, but [ZSH must be configured to use the autocompletions](https://wiki.archlinux.org/index.php/zsh#Command_completion).
:::
`asdf` scripts need to be sourced **after** you have set your `$PATH` and **after** you have sourced your framework (oh-my-zsh etc).
Restart your shell so that `PATH` changes take effect. Opening a new terminal tab will usually do it.
## 4. Install a Plugin
For demonstration purposes we will install & set [Node.js](https://nodejs.org/) via the [`asdf-nodejs`](https://github.com/asdf-vm/asdf-nodejs/) plugin.
### Plugin Dependencies
Each plugin has dependencies so we need to check the plugin repo where they should be listed. For `asdf-nodejs` they are:
| OS | Dependency Installation |
| -------------- | --------------------------------------- |
| Linux (Debian) | `apt-get install dirmngr gpg curl gawk` |
| macOS | `brew install gpg gawk` |
We should install dependencies first as some Plugins have post-install hooks.
### Install the Plugin
```shell:no-line-numbers
asdf plugin add nodejs https://github.com/asdf-vm/asdf-nodejs.git
```
## 5. Install a Version
Now we have a plugin for Node.js we can install a version of the tool.
We can observer which versions are available with `asdf list all nodejs` or a subset of versions with `asdf list all nodejs 14`.
We will just install the `latest` available version:
```shell:no-line-numbers
asdf install nodejs latest
```
::: tip Note
`asdf` enforces exact versions. `latest` is a helper throughout `asdf` that will resolve to the actual version number at the time of execution.
:::
## 6. Set a Version
`asdf` performs a version lookup of a tool in all `.tool-versions` files from the current working directory up to the `$HOME` directory. The lookup occurs just-in-time when you execute a tool that `asdf` manages.
::: warning
Without a version listed for a tool execution of the tool will **error**. `asdf current` will show you the tool & version resolution, or absence of, from your current directory so you can observe which tools will fail to execute.
:::
### Global
Global defaults are managed in `$HOME/.tool-versions`. Set a global version with:
```shell:no-line-numbers
asdf global nodejs latest
```
`$HOME/.tool-versions` will then look like:
```
nodejs 16.5.0
```
Some OSs already have tools installed that are managed by the system and not `asdf`, `python` is a common example. You need to tell `asdf` to pass the management back to the system. The [Versions reference section](/manage/versions.md) will guide you.
### Local
Local versions are defined in the `$PWD/.tool-versions` file (your current working directory). Usually, this will be the Git respository for a project. When in your desired directory execute:
```shell:no-line-numbers
asdf local nodejs latest
```
`$PWD/.tool-versions` will then look like:
```
nodejs 16.5.0
```
### Using Existing Tool Version Files
`asdf` supports the migration from existing version files from other version managers. Eg: `.ruby-version` for the case of `rbenv`. This is supported on a per-plugin basis.
[`asdf-nodejs`](https://github.com/asdf-vm/asdf-nodejs/) supports this via both `.nvmrc` and `.node-version` files. To enable this, add the following to your `asdf` configuration file `$HOME/.asdfrc`:
```
legacy_version_file = yes
```
See the [configuration](/manage/configuration.md) reference page for more config options.
## Setup Complete!
That completes the initial setup of `asdf` :tada: You can now manage `nodejs` versions for your project. Follow similar steps for each type of tool in your project!
`asdf` has a many more commands to become familiar with, you can see them all by running `asdf --help` or `asdf`. The core of the commands are broken into three categories:
- [core `asdf`](/manage/core.md)
- [plugins](/manage/plugins.md)
- [versions (of tools)](/manage/versions.md)

View File

@ -0,0 +1,57 @@
# Introduction
`asdf` is a tool version manager. All tool version definitions are contained within one file (`.tool-versions`) which you can check-in to your project's Git repository to share with your team, ensuring everyone is using the **exact** same versions of tools.
The old way of working required multiple CLI version managers, each with their distinct API, configurations files and implementation (e.g. `$PATH` manipulation, shims, environment variables, etc...). `asdf` provides a single interface and configuration file to simplify development workflows, and can be extended to all tools and runtimes via a simple plugin interface.
## How It Works
Once `asdf` core is setup with your Shell configuration, plugins are installed to manage particular tools. When a tool is installed by a plugin, the executables that are installed have [shims](<https://en.wikipedia.org/wiki/Shim_(computing)>) created for each of them. When you try and run one of these executables, the shim is run instead, allowing `asdf` to identify which version of the tool is set in `.tool-versions` and execute that version.
## Related Projects
### nvm / n / rbenv etc
Tools like [nvm](https://github.com/nvm-sh/nvm), [n](https://github.com/tj/n) and [rbenv](https://github.com/rbenv/rbenv) are all written as Shell scripts which create shims for the executables installed by these tools.
`asdf` is very similar and was built to compete in this space of tool/runtime version management. The differentiating factor for `asdf` is it's plugin system which removes the need for a manager per tool/runtime, different commands per manager and different `*-version` files in your repo.
<!-- ### pyenv
TODO: someone with Python background expand on this
`asdf` has some similarities to `pyenv` but is missing some key features. The `asdf` team is looking at introducing some of these `pyenv` specific features, though no roadmap or timeline is available. -->
### direnv
> augments existing shells with a new feature that can load and unload environment variables depending on the current directory.
`asdf` does not manage Environment Variables, however there is a plugin [`asdf-direnv`](https://github.com/asdf-community/asdf-direnv) to integrate direnv behaviour with `asdf`.
See [direnv docs](https://direnv.net/) for more.
### Homebrew
> The Missing Package Manager for macOS (or Linux)
Homebrew manages your packages and their upstream dependencies. `asdf` does not manage upstream dependencies, it is not a package manager, that burden is upon the user, though we try and keep the dependency list small.
See [Homebrew docs](https://brew.sh/) for more.
### NixOS
> Nix is a tool that takes a unique approach to package management and system configuration
NixOS aims to build truly reproducible environments by managing exact versions of packages up the entire dependency tree of each tool, something `asdf` does not do. NixOS does this with it's own programming language, many CLI tools and a pacakges collection of over 60,000 packages.
Again `asdf` does not manage upstream dependencies and is not a package manager.
See [NixOS docs](https://nixos.org/guides/how-nix-works.html) for more.
## Why use asdf?
`asdf` ensures teams are using the **exact** same versions of tools, with support for **many** tools via a plugin system, and the _simplicity and familiarity_ of being a single **Shell** script you include in your Shell config.
::: tip Note
`asdf` is not intended to be a system package manager. It is a tool version manager. Just because you can create a plugin for any tool and manage it's versions with `asdf`, does not mean that is the best course of action for that specific tool.
:::

View File

@ -1,116 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>asdf - An extendable version manager</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="description" content="An extendable version manager" />
<meta
name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"
/>
<!-- site theme -->
<link
rel="stylesheet"
href="https://unpkg.com/docsify-themeable@0/dist/css/theme-simple.css"
title="light"
/>
<!-- prismjs theme -->
<!-- <link rel="stylesheet" href="//unpkg.com/prismjs@1.15.0/themes/prism.css" /> -->
<!-- <link rel="stylesheet" href="//unpkg.com/prismjs@1.15.0/themes/prism-coy.css" /> -->
<!-- <link rel="stylesheet" href="//unpkg.com/prism-themes/themes/prism-ghcolors.css" /> -->
<!-- <link rel="stylesheet" href="//unpkg.com/prism-themes/themes/prism-atom-dark.css" /> -->
</head>
<body>
<div id="app"></div>
<!-- edit on github plugin must appear here -->
<script src="scripts/docsify-edit-on-github.js"></script>
<script>
window.$docsify = {
name: "asdf",
repo: "https://github.com/asdf-vm/asdf",
el: "#app",
coverpage: ['/', '/pt-br/'],
loadNavbar: true,
loadSidebar: true,
notFoundPage: {
'/': '_404.md',
'/pt-br/': '/pt-br/_404.md'
},
subMaxLevel: 2,
auto2top: true,
alias: {
".*?/plugins-all":
"https://raw.githubusercontent.com/asdf-vm/asdf-plugins/master/README.md",
".*?/changelog":
"https://raw.githubusercontent.com/asdf-vm/asdf/master/CHANGELOG.md",
},
markdown: {
smartypants: true,
},
themeColor: "#AA00D4",
formatUpdated: "{MM}/{DD} {HH}:{mm}",
select: {
detectOperatingSystem: {
enabled: true,
menuId: "operating-system",
},
sync: true,
theme: "classic",
},
tabs: {
theme: "material",
},
search: {
paths: "auto",
placeholder: {
"/": "Type to search",
},
noData: {
"/": "No Results",
},
},
plugins: [
EditOnGithubPlugin.create(
"https://github.com/asdf-vm/asdf/blob/master/docs/",
{
customURLs: {
"https://raw.githubusercontent.com/asdf-vm/asdf-plugins/master/README.md":
"https://github.com/asdf-vm/asdf-plugins/edit/master/README.md",
"https://raw.githubusercontent.com/asdf-vm/asdf/master/CHANGELOG.md":
"https://github.com/asdf-vm/asdf/edit/master/CHANGELOG.md",
},
}
),
],
};
</script>
<!-- docsify core -->
<script src="//unpkg.com/docsify/lib/docsify.min.js"></script>
<!-- docsify core plugins -->
<script src="//unpkg.com/docsify/lib/plugins/search.min.js"></script>
<script src="//unpkg.com/docsify/lib/plugins/emoji.min.js"></script>
<script src="//unpkg.com/docsify/lib/plugins/zoom-image.min.js"></script>
<!-- 3rd party plugins -->
<script src="https://cdn.jsdelivr.net/npm/docsify-select@1"></script>
<script src="//unpkg.com/docsify-themeable@0"></script>
<script src="//unpkg.com/docsify-copy-code@2"></script>
<script src="//unpkg.com/docsify-tabs@1"></script>
<script src="//unpkg.com/prismjs/components/prism-bash.min.js"></script>
<script src="//unpkg.com/prismjs/components/prism-markdown.min.js"></script>
<style>
:root {
/* Reduce the font size */
/* --base-font-size: 14px; */
/* Change the theme color hue */
--theme-color: #aa00d4;
/* generate new cover bg color each load */
--cover-background-color: ;
/* leave cover page title black */
--cover-heading-color: ;
}
</style>
</body>
</html>

26
docs/index.md Normal file
View File

@ -0,0 +1,26 @@
---
home: true
title: Home
# heroImage: https://vuejs.org/images/logo.png
actions:
- text: Get Started
link: /guide/getting-started.html
type: primary
- text: Introduction
link: /guide/introduction.html
type: secondary
features:
- title: One Tool
details: "Manage each of your project runtimes with a single CLI tool and command interface."
- title: Plugins
details: "Large ecosystem of existing runtimes & tools. Simple API to add support for new tools as you need!"
- title: Backwards Compatible
details: "Support for existing config files .nvmrc, .node-versions, .ruby-version for smooth migration!"
- title: "One Config File"
details: ".tool-versions to manage all your tools, runtimes and their versions in a single, sharable place."
- title: "Shells"
details: "Supports Bash, ZSH & Fish with completions available."
- title: "GitHub Actions"
details: "Provides a GitHub Action to install and utilize your .tool-verions in your CICD workflows."
# footer: MIT Licensed
---

25
docs/learn-more/faq.md Normal file
View File

@ -0,0 +1,25 @@
# FAQ
Here are some common questions regarding `asdf`.
## WSL1 support?
WSL1 ([Windows Subsystem for Linux](https://en.wikipedia.org/wiki/Windows_Subsystem_for_Linux) 1) is not officially supported. Some aspects of `asdf` may not work properly. We do not intend to add official support for WSL1.
## WSL2 support?
WSL2 ([Windows Subsystem for Linux](https://en.wikipedia.org/wiki/Windows_Subsystem_for_Linux#WSL_2) 2) should work using the setup & dependency instructions for you chosen WSL distro.
Importantly, WSL2 is _only_ expected to work properly when the current working directory is a Unix drive and not a bound Windows drive.
We intend to run out test suite on WSL2 when host runner support is available on GitHub Actions, currently this does not appear to be the case.
## Newly installed exectable not running?
> I just `npm install -g yarn`, but cannot execute `yarn`. What gives?
`asdf` uses [shims](<https://en.wikipedia.org/wiki/Shim_(computing)>) to manage executables. Those installed by plugins have shims automatically created, whereas installing executables via an `asdf` managed tool will require you to notify `asdf` of the need to create shims. In this instance, to create a shim for [Yarn](https://yarnpkg.com/). See the [`asdf reshim` command docs](/manage/core.md#reshim).
## Shell not detecting newly installed shims?
If `asdf reshim` is not resolving your issue, then it is most-likely due to the sourcing of `asdf.sh` or `asdf.fish` _not_ being at the **BOTTOM** of your Shell config file (`.bash_profile`, `.zshrc`, `config.fish` etc). It needs to be sourced **AFTER** you have set your `$PATH` and **AFTER** you have sourced your framework (oh-my-zsh etc) if any.

View File

@ -1,3 +1,7 @@
# Thanks
Thank you page to the asdf authors & contributors!
## Credits ## Credits
Me ([@HashNuke](https://github.com/HashNuke)), High-fever, cold, cough. Me ([@HashNuke](https://github.com/HashNuke)), High-fever, cold, cough.

5
docs/manage/commands.md Normal file
View File

@ -0,0 +1,5 @@
# All Commands
The list of all commands available in `asdf`. This list is the `asdf help` command text.
@[code](../../help.txt)

View File

@ -1,12 +1,18 @@
## .tool-versions # Configuration
Configuration of `asdf` encompasses both the sharable `.tool-versions` files as well as user specific customisations with `.asdfrc` and Environment Variables.
## `.tool-versions`
Whenever `.tool-versions` file is present in a directory, the tool versions it declares will be used in that directory and any subdirectories. Whenever `.tool-versions` file is present in a directory, the tool versions it declares will be used in that directory and any subdirectories.
?> Global defaults can be set in the file `$HOME/.tool-versions` ::: warning Note
Global defaults can be set in the file `$HOME/.tool-versions`
:::
This is what a `.tool-versions` file looks like: This is what a `.tool-versions` file looks like:
``` ```:no-line-numbers
ruby 2.5.3 ruby 2.5.3
nodejs 10.15.0 nodejs 10.15.0
``` ```
@ -18,25 +24,26 @@ The versions can be in the following format:
- `path:/src/elixir` - a path to custom compiled version of a tool to use. For use by language developers and such. - `path:/src/elixir` - a path to custom compiled version of a tool to use. For use by language developers and such.
- `system` - this keyword causes asdf to passthrough to the version of the tool on the system that is not managed by asdf. - `system` - this keyword causes asdf to passthrough to the version of the tool on the system that is not managed by asdf.
Multiple versions can be set by separating them with a space. For example, to use ::: tip
Python 3.7.2, fallback to Python 2.7.15 and finally to the system Python, the Multiple versions can be set by separating them with a space. For example, to use Python `3.7.2`, fallback to Python `2.7.15` and finally to the `system` Python, the following line can be added to `.tool-versions`.
following line can be added to `.tool-versions`.
``` ```:no-line-numbers
python 3.7.2 2.7.15 system python 3.7.2 2.7.15 system
``` ```
:::
To install all the tools defined in a `.tool-versions` file run `asdf install` with no other arguments in the directory containing the `.tool-versions` file. To install all the tools defined in a `.tool-versions` file run `asdf install` with no other arguments in the directory containing the `.tool-versions` file.
To install a single tool defined in a `.tool-versions` file run `asdf install <name>` in the directory containing the `.tool-versions` file. The tool will be installed at the version specified in the `.tool-versions` file. To install a single tool defined in a `.tool-versions` file run `asdf install <name>` in the directory containing the `.tool-versions` file. The tool will be installed at the version specified in the `.tool-versions` file.
Edit the file directly or use `asdf local` (or `asdf global`) which updates it. Edit the file directly or use `asdf local` (or `asdf global`) which updates it.
## \$HOME/.asdfrc ## `$HOME/.asdfrc`
Add a `.asdfrc` file to your home directory and asdf will use the settings specified in the file. The file should be formatted like this: Add a `.asdfrc` file to your home directory and asdf will use the settings specified in the file. The file should be formatted like this:
``` ```:no-line-numbers
legacy_version_file = yes legacy_version_file = yes
``` ```

338
docs/manage/core.md Normal file
View File

@ -0,0 +1,338 @@
# Core
The core `asdf` command list is rather small, but can facilitate many workflows.
## Installation & Setup
Covered in the [Getting Started](/guide/getting-started.md) guide.
## Exec
```shell:no-line-numbers
asdf exec <command> [args...]
```
Executes the command shim for the current version.
<!-- TODO: expand on this with example -->
## Env
```shell:no-line-numbers
asdf env <command> [util]
```
<!-- TODO: expand on this with example -->
## Info
```shell:no-line-numbers
asdf info
```
A helper command to print the OS, Shell and `asdf` debug information. Share this when making a bug report.
## Reshim
```shell:no-line-numbers
asdf reshim <name> <version>
```
This recreates the shims for the current version of a package. By default, shims are created by plugins during installation of a tool. Some tools like the [npm CLI](https://docs.npmjs.com/cli/) allow global installation of executables, for example, installing [Yarn](https://yarnpkg.com/) via `npm install -g yarn`. Since this executable was not installed via the plugin lifecycle, no shim exists for it yet. `asdf reshim nodejs <version>` will force recalculation of shims for any new executables, like `yarn`, for `<version>` of `nodejs` .
## Shim-versions
```shell:no-line-numbers
asdf shim-versions <command>
```
Lists the plugins and versions that provide shims for a command.
As an example, [Node.js](https://nodejs.org/) ships with two executables, `node` and `npm`. When many versions of the tools are installed with [`asdf-nodejs`](https://github.com/asdf-vm/asdf-nodejs/) `shim-versions` can return:
```shell:no-line-numbers
➜ asdf shim-versions node
nodejs 14.8.0
nodejs 14.17.3
nodejs 16.5.0
```
```shell:no-line-numbers
➜ asdf shim-versions npm
nodejs 14.8.0
nodejs 14.17.3
nodejs 16.5.0
```
## Update
`asdf` has a built in command to update which relies on Git (our recommended installation method). If you installed using a different method you should follow the steps for that method:
| Method | Latest Stable Release | Latest commit on `master` |
| -------------- | ------------------------------------------------------------------------------------------------------------------------------ | -------------------------- |
| asdf (via Git) | `asdf update` | `asdf update --head` |
| Homebrew | `brew upgrade asdf` | `brew upgrade asdf --HEAD` |
| Pacman | Download a new `PKGBUILD` & rebuild <br/> or use your preferred [AUR helper](https://wiki.archlinux.org/index.php/AUR_helpers) | |
## Uninstall
To uninstall `asdf` follow these steps:
::: details Bash & Git
1. In your `~/.bashrc` remove the lines that source `asdf.sh` and the completions:
```shell
. $HOME/.asdf/asdf.sh
. $HOME/.asdf/completions/asdf.bash
```
2. Remove the `$HOME/.asdf` dir:
```shell:no-line-numbers
rm -rf ${ASDF_DATA_DIR:-$HOME/.asdf}
```
3. Run this command to remove all `asdf` config files:
```shell:no-line-numbers
rm -rf $HOME/.tool-versions $HOME/.asdfrc
```
:::
::: details Bash & Git (macOS)
1. In your `~/.bash_profile` remove the lines that source `asdf.sh` and the completions:
```shell
. $HOME/.asdf/asdf.sh
. $HOME/.asdf/completions/asdf.bash
```
2. Remove the `$HOME/.asdf` dir:
```shell:no-line-numbers
rm -rf ${ASDF_DATA_DIR:-$HOME/.asdf}
```
3. Run this command to remove all `asdf` config files:
```shell:no-line-numbers
rm -rf $HOME/.tool-versions $HOME/.asdfrc
```
:::
::: details Bash & Homebrew (macOS)
If using **macOS Catalina or newer**, the default shell has changed to **ZSH**. If you can't find any config in your `~/.bash_profile` it may be in a `~/.zshrc` in which case please follow the ZSH instructions.
1. In your `~/.bash_profile` remove the lines that source `asdf.sh` and the completions:
```shell
. $(brew --prefix asdf)/asdf.sh
. $(brew --prefix asdf)/etc/bash_completion.d/asdf.bash
```
Completions may have been [configured as per Homebrew's instructions](https://docs.brew.sh/Shell-Completion#configuring-completions-in-bash) so follow their guide to find out what to remove.
2. Uninstall with your package manager:
```shell:no-line-numbers
brew uninstall asdf --force
```
3. Run this command to remove all `asdf` config files:
```shell:no-line-numbers
rm -rf $HOME/.tool-versions $HOME/.asdfrc
```
:::
::: details Bash & Pacman
1. In your `~/.bashrc` remove the lines that source `asdf.sh` and the completions:
```shell
. /opt/asdf-vm/asdf.sh
```
2. Uninstall with your package manager:
```shell:no-line-numbers
pacman -Rs asdf-vm
```
3. Remove the `$HOME/.asdf` dir:
```shell:no-line-numbers
rm -rf ${ASDF_DATA_DIR:-$HOME/.asdf}
```
4. Run this command to remove all `asdf` config files:
```shell:no-line-numbers
rm -rf $HOME/.tool-versions $HOME/.asdfrc
```
:::
::: details Fish & Git
1. In your `~/.config/fish/config.fish` remove the lines that source `asdf.fish`:
```shell
source ~/.asdf/asdf.fish
```
and remove completions with this command:
```shell:no-line-numbers
rm -rf ~/.config/fish/completions/asdf.fish
```
2. Remove the `$HOME/.asdf` dir:
```shell:no-line-numbers
rm -rf ${ASDF_DATA_DIR:-$HOME/.asdf}
```
3. Run this command to remove all `asdf` config files:
```shell:no-line-numbers
rm -rf $HOME/.tool-versions $HOME/.asdfrc
```
:::
::: details Fish & Homebrew
1. In your `~/.config/fish/config.fish` remove the lines that source `asdf.fish`:
```shell
source "(brew --prefix asdf)"/asdf.fish
```
2. Uninstall with your package manager:
```shell:no-line-numbers
brew uninstall asdf --force
```
3. Run this command to remove all `asdf` config files:
```shell:no-line-numbers
rm -rf $HOME/.tool-versions $HOME/.asdfrc
```
:::
::: details Fish & Pacman
1. In your `~/.config/fish/config.fish` remove the lines that source `asdf.fish`:
```shell
source /opt/asdf-vm/asdf.fish
```
2. Uninstall with your package manager:
```shell:no-line-numbers
pacman -Rs asdf-vm
```
3. Remove the `$HOME/.asdf` dir:
```shell:no-line-numbers
rm -rf ${ASDF_DATA_DIR:-$HOME/.asdf}
```
4. Run this command to remove all `asdf` config files:
```shell:no-line-numbers
rm -rf $HOME/.tool-versions $HOME/.asdfrc
```
:::
::: details ZSH & Git
1. In your `~/.zshrc` remove the lines that source `asdf.sh` and completions:
```shell
. $HOME/.asdf/asdf.sh
# ...
fpath=(${ASDF_DIR}/completions $fpath)
autoload -Uz compinit
compinit
```
**OR** the ZSH Framework plugin if used.
2. Remove the `$HOME/.asdf` dir:
```shell:no-line-numbers
rm -rf ${ASDF_DATA_DIR:-$HOME/.asdf}
```
3. Run this command to remove all `asdf` config files:
```shell:no-line-numbers
rm -rf $HOME/.tool-versions $HOME/.asdfrc
```
:::
::: details ZSH & Homebrew
1. In your `~/.zshrc` remove the lines that source `asdf.sh`:
```shell
. $(brew --prefix asdf)/asdf.sh
```
2. Uninstall with your package manager:
```shell:no-line-numbers
brew uninstall asdf --force && brew autoremove
```
3. Run this command to remove all `asdf` config files:
```shell:no-line-numbers
rm -rf $HOME/.tool-versions $HOME/.asdfrc
```
:::
::: details ZSH & Pacman
1. In your `~/.zshrc` remove the lines that source `asdf.sh`:
```shell
. /opt/asdf-vm/asdf.sh
```
2. Uninstall with your package manager:
```shell:no-line-numbers
pacman -Rs asdf-vm
```
3. Remove the `$HOME/.asdf` dir:
```shell:no-line-numbers
rm -rf ${ASDF_DATA_DIR:-$HOME/.asdf}
```
4. Run this command to remove all `asdf` config files:
```shell:no-line-numbers
rm -rf $HOME/.tool-versions $HOME/.asdfrc
```
:::
That's it! 🎉

View File

@ -1,35 +1,39 @@
Plugins are how asdf knows how to handle different tools like Node.js, Ruby, Elixir etc. # Plugins
See [Creating Plugins](plugins-create) for the plugin API used to support more tools. Plugins are how `asdf` knows to handle different tools like Node.js, Ruby, Elixir etc.
See [Creating Plugins](/plugins/create.md) for the plugin API used to support more tools.
## Add ## Add
Add plugins via their Git URL: Add plugins via their Git URL:
```shell ```shell:no-line-numbers
asdf plugin add <name> <git-url> asdf plugin add <name> <git-url>
# asdf plugin add elm https://github.com/vic/asdf-elm # asdf plugin add elm https://github.com/vic/asdf-elm
``` ```
or via the short-name association in the plugins repository: or via the short-name association in the plugins repository:
```shell ```shell:no-line-numbers
asdf plugin add <name> asdf plugin add <name>
# asdf plugin add erlang # asdf plugin add erlang
``` ```
When scripting, prefer the longer `git-url` method as it is independent of the short-name repo. ::: tip Recommendation
Prefer the longer `git-url` method as it is independent of the short-name repo.
:::
## List Installed ## List Installed
```shell ```shell:no-line-numbers
asdf plugin list asdf plugin list
# asdf plugin list # asdf plugin list
# java # java
# nodejs # nodejs
``` ```
```shell ```shell:no-line-numbers
asdf plugin list --urls asdf plugin list --urls
# asdf plugin list # asdf plugin list
# java https://github.com/halcyon/asdf-java.git # java https://github.com/halcyon/asdf-java.git
@ -38,30 +42,30 @@ asdf plugin list --urls
## List All in Short-name Repository ## List All in Short-name Repository
```shell ```shell:no-line-numbers
asdf plugin list all asdf plugin list all
``` ```
See [All plugins](plugins-all) for the short-name list of plugins. See [Plugins Shortname Index](https://github.com/asdf-vm/asdf-plugin-template) for the entire short-name list of plugins.
## Update ## Update
```shell ```shell:no-line-numbers
asdf plugin update --all asdf plugin update --all
``` ```
If you want to update a specific package, just say so. If you want to update a specific package, just say so.
```shell ```shell:no-line-numbers
asdf plugin update <name> asdf plugin update <name>
# asdf plugin update erlang # asdf plugin update erlang
``` ```
This update will fetch the *latest commit* on the *default branch* of the *origin* of the plugin repository. Versioned plugins and updates are currently being developed - https://github.com/asdf-vm/asdf/pull/916 This update will fetch the _latest commit_ on the _default branch_ of the _origin_ of the plugin repository. Versioned plugins and updates are currently being developed ([#916](https://github.com/asdf-vm/asdf/pull/916))
## Remove ## Remove
```bash ```bash:no-line-numbers
asdf plugin remove <name> asdf plugin remove <name>
# asdf plugin remove erlang # asdf plugin remove erlang
``` ```
@ -74,4 +78,4 @@ The short-name repo is synced to your local machine and periodically refreshed.
- commands `asdf plugin add <name>` or `asdf plugin list all` can trigger a sync - commands `asdf plugin add <name>` or `asdf plugin list all` can trigger a sync
- a sync occurs if there has not been one in the last `X` minutes - a sync occurs if there has not been one in the last `X` minutes
- `X` defaults to `60`, but can be configured in your `.asdfrc` via the `plugin_repository_last_check_duration` option. See the [asdf config docs](core-configuration) for more. - `X` defaults to `60`, but can be configured in your `.asdfrc` via the `plugin_repository_last_check_duration` option. See the [asdf config docs](/manage/configuration.md) for more.

View File

@ -1,71 +1,73 @@
# Versions
## Install Version ## Install Version
```shell ```shell:no-line-numbers
asdf install <name> <version> asdf install <name> <version>
# asdf install erlang 17.3 # asdf install erlang 17.3
``` ```
_If a plugin supports downloading & compiling from source, you can specify `ref:foo` where `foo` is a specific branch, tag, or commit. You'll need to use the same name and reference when uninstalling too._ If a plugin supports downloading & compiling from source, you can specify `ref:foo` where `foo` is a specific branch, tag, or commit. You'll need to use the same name and reference when uninstalling too.
## Install Latest Stable Version ## Install Latest Stable Version
```shell ```shell:no-line-numbers
asdf install <name> latest asdf install <name> latest
# asdf install erlang latest # asdf install erlang latest
``` ```
Install latest stable version that begins with a given string. Install latest stable version that begins with a given string.
```shell ```shell:no-line-numbers
asdf install <name> latest:<version> asdf install <name> latest:<version>
# asdf install erlang latest:17 # asdf install erlang latest:17
``` ```
## List Installed Versions ## List Installed Versions
```shell ```shell:no-line-numbers
asdf list <name> asdf list <name>
# asdf list erlang # asdf list erlang
``` ```
Limit versions to those that begin with a given string. Filter versions to those that begin with a given string.
```shell ```shell:no-line-numbers
asdf list <name> <version> asdf list <name> <version>
# asdf list erlang 17 # asdf list erlang 17
``` ```
## List All Available Versions ## List All Available Versions
```shell ```shell:no-line-numbers
asdf list all <name> asdf list all <name>
# asdf list all erlang # asdf list all erlang
``` ```
Limit versions to those that begin with a given string. Filter versions to those that begin with a given string.
```shell ```shell:no-line-numbers
asdf list all <name> <version> asdf list all <name> <version>
# asdf list all erlang 17 # asdf list all erlang 17
``` ```
## Show Latest Stable Version ## Show Latest Stable Version
```shell ```shell:no-line-numbers
asdf latest <name> asdf latest <name>
# asdf latest erlang # asdf latest erlang
``` ```
Show latest stable version that begins with a given string. Show latest stable version that begins with a given string.
```shell ```shell:no-line-numbers
asdf latest <name> <version> asdf latest <name> <version>
# asdf latest erlang 17 # asdf latest erlang 17
``` ```
## Set Current Version ## Set Current Version
```shell ```shell:no-line-numbers
asdf global <name> <version> [<version>...] asdf global <name> <version> [<version>...]
asdf shell <name> <version> [<version>...] asdf shell <name> <version> [<version>...]
asdf local <name> <version> [<version>...] asdf local <name> <version> [<version>...]
@ -82,11 +84,13 @@ asdf local <name> latest[:<version>]
`local` writes the version to `$PWD/.tool-versions`, creating it if needed. `local` writes the version to `$PWD/.tool-versions`, creating it if needed.
See the `.tool-versions` [file in the Configuration section](core-configuration) for details. See the `.tool-versions` [file in the Configuration section](/manage/configuration.md) for details.
?> Alternatively, if you want to set a version only for the current shell session :::warning Alternatively
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 or for executing just a command under a particular tool version, you
can set an environment variable like `ASDF_${TOOL}_VERSION`. can set an environment variable like `ASDF_${TOOL}_VERSION`.
:::
The following example runs tests on an Elixir project with version `1.4.0`. The following example runs tests on an Elixir project with version `1.4.0`.
The version format is the same supported by the `.tool-versions` file. The version format is the same supported by the `.tool-versions` file.
@ -101,14 +105,14 @@ To use the system version of tool `<name>` instead of an asdf managed version yo
Set system with either `global`, `local` or `shell` as outlined in [Set Current Version](#set-current-version) section above. Set system with either `global`, `local` or `shell` as outlined in [Set Current Version](#set-current-version) section above.
```shell ```shell:no-line-numbers
asdf local <name> system asdf local <name> system
# asdf local python system # asdf local python system
``` ```
## View Current Version ## View Current Version
```shell ```shell:no-line-numbers
asdf current asdf current
# asdf current # asdf current
# erlang 17.3 (set by /Users/kim/.tool-versions) # erlang 17.3 (set by /Users/kim/.tool-versions)
@ -121,7 +125,7 @@ asdf current <name>
## Uninstall Version ## Uninstall Version
```shell ```shell:no-line-numbers
asdf uninstall <name> <version> asdf uninstall <name> <version>
# asdf uninstall erlang 17.3 # asdf uninstall erlang 17.3
``` ```
@ -134,7 +138,9 @@ The shims themselves are really simple wrappers that `exec` a helper program `as
The `asdf exec` helper determines the version of the package to use (as specified in `.tool-versions` file, selected by `asdf local ...` or `asdf global ...`), the final path to the executable in the package installation directory (this can be manipulated by the `exec-path` callback in the plugin) and the environment to execute in (also provided by the plugin - `exec-env` script), and finally it executes it. The `asdf exec` helper determines the version of the package to use (as specified in `.tool-versions` file, selected by `asdf local ...` or `asdf global ...`), the final path to the executable in the package installation directory (this can be manipulated by the `exec-path` callback in the plugin) and the environment to execute in (also provided by the plugin - `exec-env` script), and finally it executes it.
!> Note that because this system uses `exec` 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 asdf commands: `which` and `where` can help with this by returning the path to the installed package: ::: warning Note
Because this system uses `exec` 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 `asdf` commands: `which` and `where` can help with this by returning the path to the installed package:
:::
```shell ```shell
# returns path to main executable in current version # returns path to main executable in current version

5999
docs/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

14
docs/package.json Normal file
View File

@ -0,0 +1,14 @@
{
"scripts": {
"dev": "vuepress-vite dev .",
"build": "vuepress-vite build .",
"format": "npx -y prettier --write '{.vuepress/{config,navbar,sidebar}.js,./**/*.md}'"
},
"devDependencies": {
"@vue/component-compiler-utils": "^3.2.2",
"@vuepress/plugin-back-to-top": "^2.0.0-beta.22",
"@vuepress/plugin-search": "^2.0.0-beta.22",
"@vuepress/plugin-shiki": "^2.0.0-beta.22",
"vuepress-vite": "^2.0.0-beta.22"
}
}

View File

@ -1,281 +0,0 @@
## What's in a Plugin
A plugin is a git repo, with a couple executable scripts, to support versioning another language or tool. These scripts are run when `list-all`, `install` or `uninstall` commands are run. You can set or unset env vars and do anything required to setup the environment for the tool.
## Required Scripts
- `bin/list-all` - lists all installable versions
- `bin/download` - download source code or binary for the specified version
- `bin/install` - installs the specified version
## Environment Variables
All scripts except `bin/list-all` will have access to the following env vars to act upon:
- `ASDF_INSTALL_TYPE` - `version` or `ref`
- `ASDF_INSTALL_VERSION` - if `ASDF_INSTALL_TYPE` is `version` then this will be the version number. Else it will be the git ref that is passed. Might point to a tag/commit/branch on the repo.
- `ASDF_INSTALL_PATH` - the dir where the it _has been_ installed (or _should_ be installed in case of the `bin/install` script)
These additional environment variables will be available to the `bin/install` script:
- `ASDF_CONCURRENCY` - the number of cores to use when compiling the source code. Useful for setting `make -j`.
- `ASDF_DOWNLOAD_PATH` - the path to where the source code or binary was downloaded by the `bin/download` script.
These additional environment variables will be available to the `bin/download` script:
- `ASDF_DOWNLOAD_PATH` - the path to where the source code or binary should be downloaded.
#### bin/list-all
Must print a string with a space-separated list of versions. Example output would be the following:
```
1.0.1 1.0.2 1.3.0 1.4
```
Note that the newest version should be listed last so it appears closer to the user's prompt. This is helpful since the `list-all` command prints each version on it's own line. If there are many versions it's possible the early versions will be off screen.
If versions are being pulled from releases page on a website it's recommended to not sort the versions if at all possible. Often the versions are already in the correct order or, in reverse order, in which case something like `tac` should suffice. If you must sort versions manually you cannot rely on `sort -V` since it is not supported on OSX. An alternate sort function [like this is a better choice](https://github.com/vic/asdf-idris/blob/master/bin/list-all#L6).
#### bin/download
This script must download the source or binary, in the path contained in the `ASDF_DOWNLOAD_PATH` environment variable. If the downloaded source or binary is compressed, only the uncompressed source code or binary may be placed in the `ASDF_DOWNLOAD_PATH` directory.
The script must exit with a status of `0` when the download is successful. If the download fails the script must exit with any non-zero exit status.
If possible the script should only place files in the `ASDF_DOWNLOAD_PATH`. If the download fails no files should be placed in the directory.
If this script is not present asdf will assume that the `bin/install` script is present and will download and install the version. asdf only works without this script to support legacy plugins. All plugins must include this script, and eventually support for legacy plugins will be removed.
#### bin/install
This script should install the version, in the path mentioned in `ASDF_INSTALL_PATH`. By default, asdf will create shims for any files in `$ASDF_INSTALL_PATH/bin` (this can be customized with the optional [bin/list-bin-paths](#binlist-bin-paths) script).
The install script should exit with a status of `0` when the installation is successful. If the installation fails the script should exit with any non-zero exit status.
If possible the script should only place files in the `ASDF_INSTALL_PATH` directory once the build and installation of the tool is deemed successful by the install script. asdf [checks for the existence](https://github.com/asdf-vm/asdf/blob/242d132afbf710fe3c7ec23c68cec7bdd2c78ab5/lib/utils.sh#L44) of the `ASDF_INSTALL_PATH` directory in order to determine if that version of the tool is installed. If the `ASDF_INSTALL_PATH` directory is populated at the beginning of the installation process other asdf commands run in other terminals during the installation may consider that version of the tool installed, even when it is not fully installed.
If you want your plugin to work with asdf version 0.7.* and earlier and version 0.8.* and newer check for the presence of the `ASDF_DOWNLOAD_PATH` environment variable. If it is not set download the source code in the bin/install callback. If it is set assume the `bin/download` script already downloaded it.
## Optional Scripts
#### bin/help scripts
This is not one callback script but rather a set of callback scripts that each print different documentation to STDOUT. The possible callback scripts are listed below. Note that `bin/help.overview` is a special case as it must be present for any help output to be displayed for the script.
* `bin/help.overview` - This script should output a general description about the plugin and the tool being managed. No heading should be printed as asdf will print headings. Output may be free-form text but ideally only one short paragraph. This script must be present if you want asdf to provide help information for your plugin. All other help callback scripts are optional.
* `bin/help.deps` - This script should output the list of dependencies tailored to the operating system. One dependency per line.
* `bin/help.config` - This script should print any required or optional configuration that may be available for the plugin and tool. Any environment variables or other flags needed to install or compile the tool (for the users operating system when possible). Output can be free-form text.
* `bin/help.links` - This should be a list of links relevant to the plugin and tool (again, tailored to the current operating system when possible). One link per line. Lines may be in the format `<title>: <link>` or just `<link>`.
Each of these scripts should tailor their output to the current operating system. For example, when on Ubuntu the deps script could output the dependencies as apt-get packages that must be installed. The script should also tailor its output to the value of `ASDF_INSTALL_VERSION` and `ASDF_INSTALL_TYPE` when the variables are set. They are optional and will not always be set.
The help callback script MUST NOT output any information that is already covered in the core asdf-vm documentation. General asdf usage information must not be present.
#### bin/list-bin-paths
List executables for the specified version of the tool. Must print a string with a space-separated list of dir paths that contain executables. The paths must be relative to the install path passed. Example output would be:
```
bin tools veggies
```
This will instruct asdf to create shims for the files in `<install-path>/bin`, `<install-path>/tools` and `<install-path>/veggies`
If this script is not specified, asdf will look for the `bin` dir in an installation and create shims for those.
#### bin/exec-env
Setup the env to run the binaries in the package.
#### bin/exec-path
Get the executable path for the specified version of the tool. Must print a string with the relative executable path. This allows the plugin to conditionally override the shim's specified executable path, otherwise return the default path specified by the shim.
```
Usage:
plugin/bin/exec-path <install-path> <command> <executable-path>
Example Call:
~/.asdf/plugins/foo/bin/exec-path "~/.asdf/installs/foo/1.0" "foo" "bin/foo"
Output:
bin/foox
```
#### bin/uninstall
Uninstalls a specific version of a tool.
#### bin/list-legacy-filenames
Register additional setter files for this plugin. Must print a string with a space-separated list of filenames.
```
.ruby-version .rvmrc
```
Note: This will only apply for users who have enabled the `legacy_version_file` option in their `~/.asdfrc`.
#### bin/parse-legacy-file
This can be used to further parse the legacy file found by asdf. If `parse-legacy-file` isn't implemented, asdf will simply cat the file to determine the version. The script will be passed the file path as its first argument.
#### bin/post-plugin-add
This can be used to run any post-installation actions after the plugin has been added to asdf.
The script has access to the path the plugin was installed (`${ASDF_PLUGIN_PATH}`) and the source URL (`${ASDF_PLUGIN_SOURCE_URL}`), if any was used.
See also the related hooks:
* `pre_asdf_plugin_add`
* `pre_asdf_plugin_add_${plugin_name}`
* `post_asdf_plugin_add`
* `post_asdf_plugin_add_${plugin_name}`
#### bin/pre-plugin-remove
This can be used to run any pre-removal actions before the plugin will be removed from asdf.
The script has access to the path the plugin was installed in (`${ASDF_PLUGIN_PATH}`).
See also the related hooks:
* `pre_asdf_plugin_remove`
* `pre_asdf_plugin_remove_${plugin_name}`
* `post_asdf_plugin_remove`
* `post_asdf_plugin_remove_${plugin_name}`
## Extension commands for asdf CLI.
It's possible for plugins to define new asdf commands by providing `lib/commands/command*.bash` scripts or executables that
will be callable using the asdf command line interface by using the plugin name as a subcommand.
For example, suppose a `foo` plugin has:
```shell
foo/
lib/commands/
command.bash
command-bat.bash
command-bat-man.bash
command-help.bash
```
Users can now execute
```shell
$ asdf foo # same as running `$ASDF_DATA_DIR/plugins/foo/lib/commands/command.bash`
$ asdf foo bar # same as running `$ASDF_DATA_DIR/plugins/foo/lib/commands/command.bash bar`
$ asdf foo help # same as running `$ASDF_DATA_DIR/plugins/foo/lib/commands/command-help.bash`
$ asdf foo bat man # same as running `$ASDF_DATA_DIR/plugins/foo/lib/commands/command-bat-man.bash`
$ asdf foo bat baz # same as running `$ASDF_DATA_DIR/plugins/foo/lib/commands/command-bat.bash baz`
```
Plugin authors can use this feature to provide utilities related to their tools,
or even create plugins that are just new command extensions for asdf itself.
When invoked, if extension commands do not have their executable-bit set, they will be
sourced as bash scripts, having all of the functions from `$ASDF_DIR/lib/utils.bash` available.
Also, the `$ASDF_CMD_FILE` resolves to the full path of the file being sourced.
If the executable bit is set, they are just executed and replace the asdf execution.
A good example of this feature is for plugins like [`haxe`](https://github.com/asdf-community/asdf-haxe)
which provides the `asdf haxe neko-dylibs-link` to fix an issue where haxe executables expect to find
dynamic libraries relative to the executable directory.
If your plugin provides an asdf extension command, be sure to mention about it on your plugin's README.
## Custom shim templates
**PLEASE use this feature only if absolutely required**
asdf allows custom shim templates. For an executable called `foo`, if there's a `shims/foo` file in the plugin, then asdf will copy that file instead of using it's standard shim template.
This must be used wisely. For now AFAIK, it's only being used in the Elixir plugin, because an executable is also read as an Elixir file apart from just being an executable. Which makes it not possible to use the standard bash shim.
## Testing plugins
`asdf` contains the `plugin-test` command to test your plugin. You can use it as follows
```sh
asdf plugin test <plugin-name> <plugin-url> [--asdf-tool-version <version>] [--asdf-plugin-gitref <git-ref>] [test-command*]
```
Only the two first arguments are required.
If __version_ is specified, the tool will be installed with that specific version. Defaults to whatever returns `asdf latest <plugin-name>`.
If _git-ref_ is specified, the plugin itself is checked out at that commit/branch/tag, useful for testing a pull-request on your plugin's CI.
Rest arguments are considered the command to execute to ensure the installed tool works correctly.
Normally it would be something that takes `--version` or `--help`.
For example, to test the NodeJS plugin, we could run
```sh
asdf plugin test nodejs https://github.com/asdf-vm/asdf-nodejs.git node --version
```
We strongly recommend you test your plugin on a CI environment and make sure it works on both Linux and OSX.
#### Example GitHub Action
The [asdf-vm/actions](https://github.com/asdf-vm/actions) repo provides a GitHub Action for testing your plugins hosted on github.
```yaml
steps:
- name: asdf_plugin_test
uses: asdf-vm/actions/plugin-test@v1
with:
command: "my_tool --version"
env:
GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} # automatically provided
```
#### Example TravisCI config
Here is a sample `.travis.yml` file, customize it to your needs
```yaml
language: c
script: asdf plugin test nodejs $TRAVIS_BUILD_DIR 'node --version'
before_script:
- git clone https://github.com/asdf-vm/asdf.git asdf
- . asdf/asdf.sh
os:
- linux
- osx
```
Note:
When using another CI, you will need to check what variable maps to the repo path.
You also have the option to pass a relative path to `plugin-test`.
For example, if the test script is ran in the repo directory: `asdf plugin test nodejs . 'node --version'`.
## GitHub API Rate Limiting
If your plugin's `list-all` depends on accessing the GitHub API, make sure you provide an Authorization token when accessing it, otherwise your tests might fail due to rate limiting.
To do so, create a [new personal token](https://github.com/settings/tokens/new) with only `public_repo` access.
Then on your travis.ci build settings add a _secure_ environment variable for it named something like `GITHUB_API_TOKEN`. And _DO NOT_ EVER publish your token in your code.
Finally, add something like the following to `bin/list-all`
```shell
cmd="curl -s"
if [ -n "$GITHUB_API_TOKEN" ]; then
cmd="$cmd -H 'Authorization: token $GITHUB_API_TOKEN'"
fi
cmd="$cmd $releases_path"
```
## Submitting plugins to the official plugins repository
`asdf` can easily install plugins by specifying the plugin repository url, e.g. `plugin add my-plugin https://github.com/user/asdf-my-plugin.git`.
To make it easier on your users, you can add your plugin to the official plugins repository to have your plugin listed and easily installable using a shorter command, e.g. `asdf plugin add my-plugin`.
Follow the instruction at the plugins repository: [asdf-vm/asdf-plugins](https://github.com/asdf-vm/asdf-plugins).

View File

@ -1,3 +1,5 @@
# Create a Plugin
## What's in a Plugin ## What's in a Plugin
A plugin is a git repo, with a couple executable scripts, to support versioning another language or tool. These scripts are run when `list-all`, `install` or `uninstall` commands are run. You can set or unset env vars and do anything required to setup the environment for the tool. A plugin is a git repo, with a couple executable scripts, to support versioning another language or tool. These scripts are run when `list-all`, `install` or `uninstall` commands are run. You can set or unset env vars and do anything required to setup the environment for the tool.
@ -29,7 +31,7 @@ These additional environment variables will be available to the `bin/download` s
Must print a string with a space-separated list of versions. Example output would be the following: Must print a string with a space-separated list of versions. Example output would be the following:
``` ```shell
1.0.1 1.0.2 1.3.0 1.4 1.0.1 1.0.2 1.3.0 1.4
``` ```
@ -55,7 +57,7 @@ The install script should exit with a status of `0` when the installation is suc
If possible the script should only place files in the `ASDF_INSTALL_PATH` directory once the build and installation of the tool is deemed successful by the install script. asdf [checks for the existence](https://github.com/asdf-vm/asdf/blob/242d132afbf710fe3c7ec23c68cec7bdd2c78ab5/lib/utils.sh#L44) of the `ASDF_INSTALL_PATH` directory in order to determine if that version of the tool is installed. If the `ASDF_INSTALL_PATH` directory is populated at the beginning of the installation process other asdf commands run in other terminals during the installation may consider that version of the tool installed, even when it is not fully installed. If possible the script should only place files in the `ASDF_INSTALL_PATH` directory once the build and installation of the tool is deemed successful by the install script. asdf [checks for the existence](https://github.com/asdf-vm/asdf/blob/242d132afbf710fe3c7ec23c68cec7bdd2c78ab5/lib/utils.sh#L44) of the `ASDF_INSTALL_PATH` directory in order to determine if that version of the tool is installed. If the `ASDF_INSTALL_PATH` directory is populated at the beginning of the installation process other asdf commands run in other terminals during the installation may consider that version of the tool installed, even when it is not fully installed.
If you want your plugin to work with asdf version 0.7.* and earlier and version 0.8.* and newer check for the presence of the `ASDF_DOWNLOAD_PATH` environment variable. If it is not set download the source code in the bin/install callback. If it is set assume the `bin/download` script already downloaded it. If you want your plugin to work with asdf version 0.7._ and earlier and version 0.8._ and newer check for the presence of the `ASDF_DOWNLOAD_PATH` environment variable. If it is not set download the source code in the bin/install callback. If it is set assume the `bin/download` script already downloaded it.
## Optional Scripts ## Optional Scripts
@ -76,7 +78,7 @@ The help callback script MUST NOT output any information that is already covered
List executables for the specified version of the tool. Must print a string with a space-separated list of dir paths that contain executables. The paths must be relative to the install path passed. Example output would be: List executables for the specified version of the tool. Must print a string with a space-separated list of dir paths that contain executables. The paths must be relative to the install path passed. Example output would be:
``` ```shell
bin tools veggies bin tools veggies
``` ```
@ -92,7 +94,7 @@ Setup the env to run the binaries in the package.
Get the executable path for the specified version of the tool. Must print a string with the relative executable path. This allows the plugin to conditionally override the shim's specified executable path, otherwise return the default path specified by the shim. Get the executable path for the specified version of the tool. Must print a string with the relative executable path. This allows the plugin to conditionally override the shim's specified executable path, otherwise return the default path specified by the shim.
``` ```shell
Usage: Usage:
plugin/bin/exec-path <install-path> <command> <executable-path> plugin/bin/exec-path <install-path> <command> <executable-path>
@ -111,7 +113,7 @@ Uninstalls a specific version of a tool.
Register additional setter files for this plugin. Must print a string with a space-separated list of filenames. Register additional setter files for this plugin. Must print a string with a space-separated list of filenames.
``` ```shell
.ruby-version .rvmrc .ruby-version .rvmrc
``` ```
@ -199,7 +201,7 @@ This must be used wisely. For now AFAIK, it's only being used in the Elixir plug
`asdf` contains the `plugin-test` command to test your plugin. You can use it as follows `asdf` contains the `plugin-test` command to test your plugin. You can use it as follows
```sh ```shell
asdf plugin test <plugin-name> <plugin-url> [--asdf-tool-version <version>] [--asdf-plugin-gitref <git-ref>] [test-command*] asdf plugin test <plugin-name> <plugin-url> [--asdf-tool-version <version>] [--asdf-plugin-gitref <git-ref>] [test-command*]
``` ```
@ -211,7 +213,7 @@ Rest arguments are considered the command to execute to ensure the installed too
Normally it would be something that takes `--version` or `--help`. Normally it would be something that takes `--version` or `--help`.
For example, to test the NodeJS plugin, we could run For example, to test the NodeJS plugin, we could run
```sh ```shell
asdf plugin test nodejs https://github.com/asdf-vm/asdf-nodejs.git node --version asdf plugin test nodejs https://github.com/asdf-vm/asdf-nodejs.git node --version
``` ```

View File

@ -0,0 +1,3 @@
# Getting Started
TODO: Translate

View File

@ -0,0 +1,3 @@
# Introduction
TODO: Translate

26
docs/pt-BR/index.md Normal file
View File

@ -0,0 +1,26 @@
---
home: true
title: Home
# heroImage: https://vuejs.org/images/logo.png
actions:
- text: "TODO: Translate"
link: /pt-BR/guide/getting-started.html
type: primary
- text: "TODO: Translate"
link: /pt-BR/guide/introduction.html
type: secondary
features:
- title: One Tool
details: "Manage each of your project runtimes with a single CLI tool and command interface."
- title: Plugins
details: "Large ecosystem of existing runtimes & tools. Simple API to add support for new tools as you need!"
- title: Backwards Compatible
details: "Support for existing config files .nvmrc, .node-versions, .ruby-version for smooth migration!"
- title: "One Config File"
details: ".tool-versions to manage all your tools, runtimes and their versions in a single, sharable place."
- title: "Shells"
details: "Supports Bash, ZSH & Fish with completions available."
- title: "GitHub Actions"
details: "Provides a GitHub Action to install and utilize your .tool-verions in your CICD workflows."
# footer: MIT Licensed
---

View File

@ -1,13 +0,0 @@
<h2 align="center">404</h2>
<div style="text-align:center">
Parece que estamos perdido! :sweat_smile:
Voltar para a [página inicial](/pt-br/).
Se estiver perdido novamente, [grite por ajuda ](https://github.com/asdf-vm/asdf/issues/new) :mega:
Se você está aqui por causa de uma página ou tradução faltando, [pense em contribuir ](contributing-doc-site) :two_hearts:
</div>

View File

@ -1,14 +0,0 @@
<!-- ![logo](_media.asdf-logo.svg) -->
# asdf
> Gerencie múltiplas versões com um simples CLI
<!-- insert asciinema or other gif here -->
- Bash, Zsh, Fish
- Node.js, Ruby, Python, Elixir ... [qual sua linguagem favorita?](plugins-all?id=plugin-list)
- Extensivo com um simples sistema de plugins
[GitHub](https://github.com/asdf-vm/asdf)
[Começar](/pt-br/core-manage-asdf)

View File

@ -1,4 +0,0 @@
- Tradução
- [:uk: English](/)
- [:brazil: Português](/pt-br/)
- [Adicionar tradução](/pt-br/contributing-doc-site?id=translations)

View File

@ -1,20 +0,0 @@
<!-- docs/_sidebar.md -->
- **Núcleo**
- [Gerenciar asdf](/pt-br/core-manage-asdf)
- [Gerenciar Plugins](/pt-br/core-manage-plugins)
- [Gerenciar Versões](/pt-br/core-manage-versions)
- [Configuração](/pt-br/core-configuration)
- [Todos os comandos](/pt-br/core-commands)
- [Alterações](/pt-br/changelog) <!-- pulls in changelog from repo -->
- **Plugins**
- [Criar Plugins](/pt-br/plugins-create)
- [Todos os Plugins](/pt-br/plugins-all) <!-- pulls in asdf-vm/asdf-plugins readme -->
- **Contribuições**
- [Núcleo asdf](/pt-br/contributing-core-asdf)
- [Documentação](/pt-br/contributing-doc-site)
- [Agradecimentos](/pt-br/thanks)
- **Comunidade & Questões**
- [![GitHub Issues](https://icongr.am/simple/github.svg?color=808080&size=16) GitHub Issues](https://github.com/asdf-vm/asdf/issues)
- [![GitHub Discussions](https://icongr.am/simple/github.svg?color=808080&size=16) GitHub Discussions](https://github.com/asdf-vm/asdf/discussions)
- [![StackOverflow Tag](https://icongr.am/fontawesome/stack-overflow.svg?size=16&color=808080) StackOverflow Tag](https://stackoverflow.com/questions/tagged/asdf-vm)

View File

@ -1,20 +0,0 @@
## Desenvolvimento
Para desenvolver o projeto, use `git clone` na _master branch_.
Se você quiser experimentar suas mudanças sem fazer alterações em seu `asdf` instalado, você pode definir a variável `$ ASDF_DIR` para o caminho onde você clonou o repositório, e adicionar temporariamente o diretório `bin` e `shims`.
Ferramentas que usamos:
- [bats](https://github.com/bats-core/bats-core) para testes. Certificar-se de que `bats test /` passa nos testes após você fazer suas alterações.
- [Shellcheck](https://github.com/koalaman/shellcheck) para análise estática dos scripts shell.
## Imagem Docker
Os projetos [asdf-alpine] [asdf-alpine] e [asdf-ubuntu] [asdf-ubuntu] são um
esforço contínuo para fornecer imagens docker de algumas ferramentas asdf. Você pode usar
essas imagens docker como base para seus servidores de desenvolvimento, ou para executar seu
aplicativos em produção.
[asdf-alpine]: https://github.com/vic/asdf-alpine
[asdf-ubuntu]: https://github.com/vic/asdf-ubuntu

View File

@ -1,69 +0,0 @@
## Melhorias
Aqui está uma lista de melhorias que estamos tentando fazer na documentação. Se você deseja contribuir, de uma olhadinha nisso:
- customise the docsify theme
- cover-page background image
- cover-page/readme gif of a terminal using asdf showing it's features (automatic version switching, .tool-versions with multiple runtime configs)
- custom doc site domain
- change the typography
- get a logo?
- improve "edit on GitHub" button/link
- add asdf to awesome-docsify showcase
## Configure seu ambiente
Estamos usando:
- [Node.js](https://github.com/asdf-vm/asdf-nodejs) `v10.15.0` para dar suporte as outras ferramentas necessárias
- [docsify](https://docsify.js.org/#/) para criar a documentação
- [prettier](https://prettier.io/) para formatar arquivos de _markdown_ (.md)
### Instalar dependências
Estamos tentando **evitar poluir** o repositório central com ferramentas para esta documentação. Sendo assim, seria ótimo se você pudesse instalar essas ferramentas de desenvolvimento **globalmente** para não comprometê-las com este projeto.
```shell
npm i docsify-cli prettier -g
```
## Subir servidor
Execute na raiz do projeto:
```shell
docsify serve docs
```
## Formatar arquivos
Execute na raiz do projeto:
```shell
prettier --write "docs/**/*.md"
```
## Traduções
Seria ótimo fornecer traduções para outros idiomas.
O Docsify torna a adição de novos idiomas bastante fácil. Veja em `docs/index.html` para exemplos de `zh-cn`.
### Adicionar uma nova tradução
1. Crie uma pasta dentro do `docs/` para adicionar sua nova tradução
```
docs/
docs/zh-cn/
```
2. copie o arquivo `docs/_404.md` para sua nova pasta `docs/zh-cn/_404.md`
```
docs/_404.md
docs/zh-cn/_404.md
```
3. troque o texto com a sua tradução.
4. repita o processo para todos os arquivos.
5. adicione o _link_ da sua tradução em `_navbar.md`.
6. execute o `prettier` antes de fazer o _commit_ das alterações.
Para mais informações veja em [configurações do docsify](https://docsify.js.org/#/configuration), para [barra lateral (navbar)](https://docsify.js.org/#/custom-navbar), verifique o `index.html` e [campo de pesquisa](https://github.com/docsifyjs/docsify/blob/6ac7bace213145cb655e9a5e9e209384db08e5f9/docs/index.html#L48).

View File

@ -1,9 +0,0 @@
<!--
single source of truth.
import commands list from master branch of repo.
not amenable to docs supporting git refs. Solution to be determined.
-->
`asdf` ou `asdf help` para listar todos os comandos disponíveis para sua versão.
[](https://raw.githubusercontent.com/asdf-vm/asdf/master/help.txt ':include')

View File

@ -1,56 +0,0 @@
## .tool-versions
Sempre que o arquivo `.tool-versions` estiver presente em um diretório, as versões da ferramenta que ele declara serão usadas nesse diretório e em seus subdiretórios.
?> Configurações globais podem ser modificadas no arquivo `$HOME/.tool-versions`
O arquivo `.tool-versions` se parece assim:
```
ruby 2.5.3
nodejs 10.15.0
```
As versões podem estar no seguinte formato:
- `10.15.0` - uma versão real. Os plugins que suportam o download de binários farão o download de binários.
- `ref:v1.0.2-a` ou `ref:39cb398vb39` - _tag/commit/branch_ para download pelo github e compilação
um path costumizado e compi
- `path:/src/elixir` - um path para uma versão compilada e personalizada de uma ferramenta pronta para usar. Para uso por linguagens de desenvolvimento e outros.
- `system` - faz com que asdf passe para a versão da ferramenta no sistema que não é gerenciada por asdf .
Várias versões podem ser definidas, separando-as com um espaço. Por exemplo, para usar Python 3.7.2, e também Python 2.7.15, use a linha abaixo em seu arquivo `.tool-versions`.
```
python 3.7.2 2.7.15 system
```
Para instalar todas as ferramentas definidas em `.tool-versions`, execute o camando `asdf install` sem argumentos no mesmo diretório de `.tool-versions`.
Para isntalar somente uma ferramenta definida em `.tool-versions`, execute o camando `asdf install` sem argumentos no mesmo diretório de `.tool-versions`. A ferramenta será instalada na versão especificada no arquivo `.tool-versions`.
Edite o arquivo diretamente no diretório ou use `asdf local` (ou `asdf global`) para atualiza-lo.
## \$HOME/.asdfrc
Adicione um arquivo `.asdfrc` ao seu diretório home e asdf usará as configurações especificadas no arquivo. O arquivo deve ser formatado assim:
```
legacy_version_file = yes
```
**Configurações**
- `legacy_version_file` - por padrão é `no`. Se definido como `yes`, fará com que os plug-ins que suportam esse recurso leiam os arquivos de versão usados por outros gerenciadores de versão (por exemplo, `.ruby-version` no caso do ` rbenv` do Ruby).
- `use_release_candidates` - por padrão é `no`. Se definido como `yes`, fará com que o comando `asdf update` atualize para o mais recente em vez da versão semântica mais recente.
- `always_keep_download` - por padrão é `no`. Se definido como `yes`, fará com que o ` asdf install` sempre mantenha o código-fonte ou binário baixado. Se definido como `no`, o código fonte ou binário baixado por ` asdf install` será excluído após a instalação bem sucedida.
- `plugin_repository_last_check_duration` - por padrão é `60` min (1 hrs). Ele define a duração da última verificação do repositório de plugins asdf. Quando o comando `asdf plugin add <nome>`, `asdf plugin list all` for executado, ele verificará a duração da última atualização para atualizar o repositório. Se definido como `0`, ele atualizará o repositório de plugins asdf todas as vezes.
## Variáveis de ambiente
- `ASDF_CONFIG_FILE` - O padrão é `~ / .asdfrc` conforme descrito acima. Pode ser definido para qualquer local.
- `ASDF_DEFAULT_TOOL_VERSIONS_FILENAME` - O nome do arquivo que armazena os nomes e versões das ferramentas. O padrão é `.tool-versions`. Pode ser qualquer nome de arquivo válido. Normalmente você não deve substituir o valor padrão, a menos que deseja que o asdf ignore os arquivos `.tool-versions`.
- `ASDF_DIR` - O padrão é `~/.asdf` - Localização dos arquivos `asdf`. Se você instalar `asdf` em algum outro diretório, defina-o para esse diretório. Por exemplo, se você estiver instalando através do AUR, você deve definir isso para `/ opt / asdf-vm`.
- `ASDF_DATA_DIR` - O padrão é `~/.asdf` - Local onde `asdf` instala plugins, correções e instalações. Pode ser definido para qualquer local antes de fornecer `asdf.sh` ou` asdf.fish` mencionado na seção acima.

View File

@ -1,634 +0,0 @@
1. [Gerenciar asdf](/pt-br/core-manage-asdf): instalar `asdf` **e** adicionar `asdf` ao seu shell
2. [Gerenciar Plugins](/pt-br/core-manage-plugins): adicionar plugin para sua ferramenta `asdf plugin add nodejs`
3. [Gerenciar Versões](/pt-br/core-manage-versions): instalar uma versão da sua ferramenta `asdf install nodejs 13.14.0`
4. [Configuração](/pt-br/core-configuration): configurações globais e de seu projeto em `.tool-versions`
## Instalar
### Dependências
<!-- select:start -->
<!-- select-menu-labels: Sistema Operacional,Método de Instalação -->
#### -- Linux,Aptitude --
```shell
sudo apt install curl git
```
#### -- Linux,DNF --
```shell
sudo dnf install curl git
```
#### -- Linux,Pacman --
```shell
sudo pacman -S curl git
```
#### -- Linux,Zypper --
```shell
sudo zypper install curl git
```
#### -- macOS,Homebrew --
Dependências seram instaladas automaticamente pelo Homebrew.
#### -- macOS,Spack --
```shell
spack install coreutils curl git
```
### -- Docsify Select Default --
Não encontrado seleção para seu _Sistema Operacional_ e _Método de Instalação_. Por favor tente outra combinação.
<!-- select:end -->
### asdf
<!-- select:start -->
<!-- select-menu-labels: Método de Instalação -->
### --Git--
Clone somente a _branch_ mais recente:
```shell
git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.8.1
```
Alternativa, você pode clonar o repositório completo e verificar a _branch_ mais recente:
```shell
git clone https://github.com/asdf-vm/asdf.git ~/.asdf
cd ~/.asdf
git checkout "$(git describe --abbrev=0 --tags)"
```
### --Homebrew--
Seja a compatibilidade de `asdf` e Homebrew em [issues in #785](https://github.com/asdf-vm/asdf/issues/785).
Instalar usando o gerenciador de pacotes Homebrew:
```shell
brew install asdf
```
Para pegar as mudanças mais recentes, você pode mandar o Homebrew obter a _branch_ central do repositório:
```shell
brew install asdf --HEAD
```
### --Pacman--
Instalar usando `pacman`:
```shell
git clone https://aur.archlinux.org/asdf-vm.git
cd asdf-vm
makepkg -si
```
Ou use outro de sua preferência [AUR helper](https://wiki.archlinux.org/index.php/AUR_helpers)
<!-- select:end -->
### Adicionando ao seu Shell
<!-- select:start -->
<!-- select-menu-labels: Sistema Operacional,Shell,Método de Instalação -->
#### --Linux,Bash,Git--
Adicione em seu `~/.bashrc`:
```shell
. $HOME/.asdf/asdf.sh
```
?> Adicione também em seu `.bashrc`:
```shell
. $HOME/.asdf/completions/asdf.bash
```
#### --Linux,Fish,Git--
Adicione em seu `~/.config/fish/config.fish`:
```shell
source ~/.asdf/asdf.fish
```
?> Execute o comando:
```shell
mkdir -p ~/.config/fish/completions; and ln -s ~/.asdf/completions/asdf.fish ~/.config/fish/completions
```
#### --Linux,ZSH,Git--
Adicione em seu `~/.zshrc`:
```shell
. $HOME/.asdf/asdf.sh
```
**Ou** use o ZSH Framework plugin descrito em [asdf para oh-my-zsh](https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/asdf) para concluir sua configuração.
?> As configurações são completadas através do ZSH Framework `asdf` plugin ou pelas modificações feitas em `.zshrc`:
```shell
# adicione ao seu fpath
fpath=(${ASDF_DIR}/completions $fpath)
# termine usando os comandos do ZSH's compinit
autoload -Uz compinit
compinit
```
- Caso tiver usando uma costumização de `compinit`, garanta que seu `compinit` esteja dentro do arquivo `asdf.sh`
- Caso tiver usando uma costumização de `compinit` e ZSH Framework, garanta que `compinit` esteja dentro do framework
!> Caso tiver usando ZSH Framework em conjunto com `asdf`, talvez seja necessário atualizar os complementos de ZSH no `fpath`. Para atualizar Oh-My-ZSH asdf plugin, seja em https://github.com/ohmyzsh/ohmyzsh/pull/8837.
#### --Linux,Bash,Pacman--
Adicione em seu `~/.bashrc`:
```shell
. /opt/asdf-vm/asdf.sh
```
?> [`bash-completion` needs to be installed for the completions to work](https://wiki.archlinux.org/title/bash#Common_programs_and_options)
#### --Linux,Fish,Pacman--
Adicione em seu `~/.config/fish/config.fish`:
```shell
source /opt/asdf-vm/asdf.fish
```
!> Os complementos são automaticamente configurados na instalação feita pelo pacote AUR.
#### --Linux,ZSH,Pacman--
Adicione em seu `~/.zshrc`:
```shell
. /opt/asdf-vm/asdf.sh
```
?> Os complementos são colocados em um local escolhido pelo ZHS, para mais [ZSH deve ser usado para configurações dos complementos](https://wiki.archlinux.org/index.php/zsh#Command_completion).
#### --macOS,Bash,Git--
Caso esteja usando **macOs Catalina ou mais recente**, por padrão o _shell_ é **ZSH**. Para voltar ao _Bash_ siga as instruções do ZSH.
Adicione em seu `~/.bash_profile`:
```shell
. $HOME/.asdf/asdf.sh
```
?> Os complementos precisam ser configurados manualmente em seu arquivo `.bash_profile`:
```shell
. $HOME/.asdf/completions/asdf.bash
```
#### --macOS,Fish,Git--
Adicione em seu `~/.config/fish/config.fish`:
```shell
source ~/.asdf/asdf.fish
```
?> Os complementos precisam ser configurados manualmente com esse comando:
```shell
mkdir -p ~/.config/fish/completions; and cp ~/.asdf/completions/asdf.fish ~/.config/fish/completions
```
#### --macOS,ZSH,Git--
Adicione em seu `~/.zshrc`:
```shell
. $HOME/.asdf/asdf.sh
```
**Ou** use ZSH Framework plugin descrito em [asdf para oh-my-zsh](https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/asdf) que irá realizar as configurações.
?> Os complementos são conficurados usando ZSH Framework `asdf` plugin ou através do arquivo `.zshrc`:
```shell
# adicione em seu fpath
fpath=(${ASDF_DIR}/completions $fpath)
# termine usando os comandos do ZSH's compinit
autoload -Uz compinit
compinit
```
- Caso tiver usando uma costumização de `compinit`, garanta que seu `compinit` esteja dentro do arquivo `asdf.sh`
- Caso tiver usando uma costumização de `compinit` e ZSH Framework, garanta que `compinit` esteja dentro do framework
!> Caso tiver usando ZSH Framework em conjunto com `asdf`, talvez seja necessário atualizar os complementos de ZSH no `fpath`. Para atualizar Oh-My-ZSH asdf plugin, seja em https://github.com/ohmyzsh/ohmyzsh/pull/8837.
#### --macOS,Bash,Homebrew--
Caso esteja usando **macOs Catalina ou mais recente**, por padrão o _shell_ é **ZSH**. Para voltar ao _Bash_ siga as instruções do ZSH.
Adicione `asdf.sh` ao seu `~/.bash_profile` usando:
```shell
echo -e "\n. $(brew --prefix asdf)/asdf.sh" >> ~/.bash_profile
```
?> Os complementos precisam [instruções de configuração do Homebrew](https://docs.brew.sh/Shell-Completion#configuring-completions-in-bash) ou usando:
```shell
echo -e "\n. $(brew --prefix asdf)/etc/bash_completion.d/asdf.bash" >> ~/.bash_profile
```
#### --macOS,Fish,Homebrew--
Adicione `asdf.fish` ao seu `~/.config/fish/config.fish` usando:
```shell
echo -e "\nsource "(brew --prefix asdf)"/asdf.fish" >> ~/.config/fish/config.fish
```
?> Os complementos são [manipulados pelo Homebrew para o Fish shell](https://docs.brew.sh/Shell-Completion#configuring-completions-in-fish). Legal!
#### --macOS,ZSH,Homebrew--
Adicione `asdf.sh` ao seu `~/.zshrc` usando:
```shell
echo -e "\n. $(brew --prefix asdf)/asdf.sh" >> ${ZDOTDIR:-~}/.zshrc
```
**Ou** use ZSH Framework plugin descrito em [asdf para oh-my-zsh](https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/asdf) que irá realizar as configurações.
?> Os complementos são configurados pelo ZSH Framework `asdf` ou precisam [instruções de configuração do Homebrew](https://docs.brew.sh/Shell-Completion#configuring-completions-in-zsh)
Caso tiver usando ZSH Framework em conjunto com `asdf`, talvez seja necessário atualizar os complementos de ZSH no `fpath`. Para atualizar Oh-My-ZSH asdf plugin, seja em https://github.com/ohmyzsh/ohmyzsh/pull/8837.
### --Docsify Select Default--
!> O `Homebrew` `asdf` não possui testes no `Linux` feitos pelo time central do asdf. Por favor reporte os problemas para que possamos atualizar nossa documentação.
<!-- select:end -->
Reinicie seu _shell_ para que as mudanças no _PATH_ sejam efetivadas.
Esta tudo pronto para usar asdf 🎉
### Possui questionamentos?
Caso tenha questionamentos sobre seu _shell_ não detectadas em instalações mais recentes, pode ser que `asdf.sh` ou `asdf.fish` não iniciou o **BOTTOM** em seu arquivo de configuração `.bash_profile`, `.zshrc`, `config.fish`. É preciso do **AFETER** em seu `$PATH` e **AFTER** precisa estar em seu framework (oh-my-zsh etc).
you have sourced your framework (oh-my-zsh etc).
### Migrando de ferramentas
Caso tenha migrado para outra ferramenta e precisar usar as arquivos de versão (ex: `.node-version` ou `.ruby-version`),
olhe em seu `legacy_version_file` [marcação de seleção de configuração](core-configuration?id=homeasdfrc).
## Atualizar
<!-- select:start -->
<!-- select-menu-labels: Método de Instalação -->
### -- Git --
```shell
asdf update
```
Caso queira as últimas mudanças, essas mudanças não estão incluídas na versão estável:
```shell
asdf update --head
```
### -- Homebrew --
```shell
brew upgrade asdf
```
### -- Pacman --
Obter manualmente um novo `PKGBUILD` e reconstruir ou usar suas preferências de AUR.
<!-- select:end -->
## Remover
Para desinstalar `asdf` siga os passos:
<!-- select:start -->
<!-- select-menu-labels: Sistema Operacional,Shell,Método de Instalação -->
### --Linux,Bash,Git--
1. Em seu `~/.bashrc` remova as linhas do `asdf.sh` e seus complementos:
```shell
. $HOME/.asdf/asdf.sh
. $HOME/.asdf/completions/asdf.bash
```
2. Remova o diretório `$HOME/.asdf`:
```shell
rm -rf ${ASDF_DATA_DIR:-$HOME/.asdf}
```
3. Execute o comando para remover todos os arquivos de configurações do `asdf`:
```shell
rm -rf $HOME/.tool-versions $HOME/.asdfrc
```
### --Linux,Fish,Git--
1. Em seu `~/.config/fish/config.fish` remova as linhas do `asdf.sh`:
```shell
source ~/.asdf/asdf.fish
```
e remova os complementos de com esse comando:
```shell
rm -rf ~/.config/fish/completions/asdf.fish
```
2. Remova o diretório `$HOME/.asdf`:
```shell
rm -rf ${ASDF_DATA_DIR:-$HOME/.asdf}
```
3. Execute o comando para remover todos os arquivos de configurações do `asdf`:
```shell
rm -rf $HOME/.tool-versions $HOME/.asdfrc
```
### --Linux,ZSH,Git--
1. Em seu `~/.zshrc` remova as linhas do `asdf.sh` e seus complementos:
```shell
. $HOME/.asdf/asdf.sh
# ...
fpath=(${ASDF_DIR}/completions $fpath)
autoload -Uz compinit
compinit
```
**Ou** use ZSH Framework plugin.
2. Remova o diretório `$HOME/.asdf`:
```shell
rm -rf ${ASDF_DATA_DIR:-$HOME/.asdf}
```
3. Execute o comando para remover todos os arquivos de configurações do `asdf`:
```shell
rm -rf $HOME/.tool-versions $HOME/.asdfrc
```
### --Linux,Bash,Pacman--
1. Em seu `~/.bashrc` remova as linhas do `asdf.sh` e seus complementos:
```shell
. /opt/asdf-vm/asdf.sh
```
2. Desinstale usando seu gerenciador de pacotes:
```shell
pacman -Rs asdf-vm
```
3. Remova o diretório `$HOME/.asdf`:
```shell
rm -rf ${ASDF_DATA_DIR:-$HOME/.asdf}
```
4. Execute o comando para remover todos os arquivos de configurações do `asdf`:
```shell
rm -rf $HOME/.tool-versions $HOME/.asdfrc
```
### --Linux,Fish,Pacman--
1. Em seu `~/.config/fish/config.fish` remova as linhas do `asdf.fish`:
```shell
source /opt/asdf-vm/asdf.fish
```
2. Desinstale usando seu gerenciador de pacotes:
```shell
pacman -Rs asdf-vm
```
3. Remova o diretório `$HOME/.asdf`:
```shell
rm -rf ${ASDF_DATA_DIR:-$HOME/.asdf}
```
4. Execute o comando para remover todos os arquivos de configurações do `asdf`:
```shell
rm -rf $HOME/.tool-versions $HOME/.asdfrc
```
### --Linux,ZSH,Pacman--
1. Em seu `~/.zshrc` remova as linhas do `asdf.sh`:
```shell
. /opt/asdf-vm/asdf.sh
```
2. Desinstale usando seu gerenciador de pacotes:
```shell
pacman -Rs asdf-vm
```
3. Remova o diretório `$HOME/.asdf`:
```shell
rm -rf ${ASDF_DATA_DIR:-$HOME/.asdf}
```
4. Execute o comando para remover todos os arquivos de configurações do `asdf`:
```shell
rm -rf $HOME/.tool-versions $HOME/.asdfrc
```
### --macOS,Bash,Git--
1. Em seu `~/.bash_profile` remova as linhas do `asdf.sh` e remova seus complementos:
```shell
. $HOME/.asdf/asdf.sh
. $HOME/.asdf/completions/asdf.bash
```
2. Remova o diretório `$HOME/.asdf`:
```shell
rm -rf ${ASDF_DATA_DIR:-$HOME/.asdf}
```
3. Execute o comando para remover todos os arquivos de configurações do `asdf`:
```shell
rm -rf $HOME/.tool-versions $HOME/.asdfrc
```
### --macOS,Fish,Git--
1. Em seu `~/.config/fish/config.fish` remova as linhas do `asdf.fish`:
```shell
source ~/.asdf/asdf.fish
```
e remova os complementos de com esse comando:
```shell
rm -rf ~/.config/fish/completions/asdf.fish
```
2. Remova o diretório `$HOME/.asdf`:
```shell
rm -rf ${ASDF_DATA_DIR:-$HOME/.asdf}
```
3. Execute o comando para remover todos os arquivos de configurações do `asdf`:
```shell
rm -rf $HOME/.tool-versions $HOME/.asdfrc
```
### --macOS,ZSH,Git--
1. Em seu `~/.zshrc` remova as linhas do `asdf.sh` e remova seus complementos:
```shell
. $HOME/.asdf/asdf.sh
# ...
fpath=(${ASDF_DIR}/completions $fpath)
autoload -Uz compinit
compinit
```
**Ou** use ZSH Framework plugin.
2. Remova o diretório `$HOME/.asdf`:
```shell
rm -rf ${ASDF_DATA_DIR:-$HOME/.asdf}
```
3. Execute o comando para remover todos os arquivos de configurações do `asdf`:
```shell
rm -rf $HOME/.tool-versions $HOME/.asdfrc
```
### --macOS,Bash,Homebrew--
Caso esteja usando **macOs Catalina ou mais recente**, por padrão o _shell_ é **ZSH**. Se não achar alguma configuração em seu `~/.bash_profile` talvez esteja em `~/.zshrc` em cada caso siga as intruções do ZSH.
1. Em seu `~/.bash_profile` remova as linhas do `asdf.sh` e remova seus complementos:
```shell
. $(brew --prefix asdf)/asdf.sh
. $(brew --prefix asdf)/etc/bash_completion.d/asdf.bash
```
?> Os complementos precisam [instruções de configuração do Homebrew](https://docs.brew.sh/Shell-Completion#configuring-completions-in-bash) e siga o guia de remoção.
2. Desinstale usando seu gerenciador de pacotes:
```shell
brew uninstall asdf --force
```
3. Execute o comando para remover todos os arquivos de configurações do `asdf`:
```shell
rm -rf $HOME/.tool-versions $HOME/.asdfrc
```
### --macOS,Fish,Homebrew--
1. Em seu `~/.config/fish/config.fish` remova as linhas do `asdf.fish`:
```shell
source "(brew --prefix asdf)"/asdf.fish
```
2. Desinstale usando seu gerenciador de pacotes:
```shell
brew uninstall asdf --force
```
3. Execute o comando para remover todos os arquivos de configurações do `asdf`:
```shell
rm -rf $HOME/.tool-versions $HOME/.asdfrc
```
### --macOS,ZSH,Homebrew--
1. Em seu `~/.zshrc` remova as linhas do `asdf.sh`:
```shell
. $(brew --prefix asdf)/asdf.sh
```
2. Desinstale usando seu gerenciador de pacotes:
```shell
brew uninstall asdf --force
```
3. Execute o comando para remover todos os arquivos de configurações do `asdf`:
```shell
rm -rf $HOME/.tool-versions $HOME/.asdfrc
```
<!-- select:end -->
Tudo pronto! 🎉

View File

@ -1,77 +0,0 @@
Plugins são como asdf sabe lidar com diferentes ferramentas, tais quais Node.js, Ruby, Elixir etc.
Seja em [Criar Plugins](/pt-br/plugins-create) para usar API de plugin e ter suporte as ferramentas.
## Adicionar
Adicione os plugins via sua Url Git:
```shell
asdf plugin add <name> <git-url>
# asdf plugin add elm https://github.com/vic/asdf-elm
```
ou pelo nome abreviado dentro do repositório de plugins:
```shell
asdf plugin add <name>
# asdf plugin add erlang
```
Ao criar scripts, prefira o método mais longo `git-url`, pois ele é independente do repositório de nome abreviado.
## Listar Instalados
```shell
asdf plugin list
# asdf plugin list
# java
# nodejs
```
```shell
asdf plugin list --urls
# asdf plugin list
# java https://github.com/halcyon/asdf-java.git
# nodejs https://github.com/asdf-vm/asdf-nodejs.git
```
## Listar todos nomes abreviados no repositório
```shell
asdf plugin list all
```
Veja Todos os plugins(/pt-br/plugins-all) para os nomes abreviados dos plugins.
## Atualizar
```shell
asdf plugin update --all
```
Se você quiser atualizar um pacote específico, apenas use.
```shell
asdf plugin update <name>
# asdf plugin update erlang
```
Esta atualização irá buscar o último _commit_ na _branch_ padrão no _origin_ de seu respositório. Plugins e atualizações das versões estão sendo desenvolvidas - https://github.com/asdf-vm/asdf/pull/916
## Remover
```bash
asdf plugin remove <name>
# asdf plugin remove erlang
```
Removendo o plugin irá remover todas as instalações feitas com o plugin. Isso pode ser usado como um atalho para apagar/remover sujeiras de versões não utilizadas de uma ferramenta.
## Sincronizar nome abreviado no repositório
O nome abreviado do repositório é sincronizado em seu máquina local e periodicamente atualizado. Esse período pode ser determinado com o seguinte método:
- comandos `asdf plugin add <name>` ou `asdf plugin list all` disparam a sincronização
- ocorre uma sincronização se não houver nenhuma nos últimos `X` minutos
- `X` por padrão é `60`, mas pode ser mudado em `.asdfrc` via as opções do `plugin_repository_last_check_duration`. Seja mais em [asdf documentação de configuração](/pt-br/core-configuration).

View File

@ -1,137 +0,0 @@
## Instalar Versão
```shell
asdf install <name> <version>
# asdf install erlang 17.3
```
_Se um plugin suporta o download e compilação do código-fonte, você pode especificar `ref:foo` no qual `foo` é uma 'branch' especifica, 'tag', ou 'commit'. Você também precisará usar o mesmo nome e referência ao desinstalar._
## Instalar última versão estável
```shell
asdf install <name> latest
# asdf install erlang latest
```
Instale a última versão estável que inicia com um texto.
```shell
asdf install <name> latest:<version>
# asdf install erlang latest:17
```
## Listar versões instaladas
```shell
asdf list <name>
# asdf list erlang
```
## Listar todas as versões disponíveis
```shell
asdf list all <name>
# asdf list all erlang
```
Limite as versões que inicie com um determinado texto.
```shell
asdf list all <name> <version>
# asdf list all erlang 17
```
## Mostrar última versão estável
```shell
asdf latest <name>
# asdf latest erlang
```
Mostrar última versão estável que inicie com um determinado texto.
```shell
asdf latest <name> <version>
# asdf latest erlang 17
```
## Selecionar versão atual
```shell
asdf global <name> <version> [<version>...]
asdf shell <name> <version> [<version>...]
asdf local <name> <version> [<version>...]
# asdf global elixir 1.2.4
```
`global` escreve a versão para `$HOME/.tool-versions`.
`shell` selecione a versão na variável de ambiente `ASDF_${LANG}_VERSION`, para a atual seção do _shell_.
`local` escreve a versão para `$PWD/.tool-versions`, crie se necessário .
Veja em `.tool-versions` [arquivo de seleção de configuração](/pt-br/core-configuration) para mais detalhes.
?> Alternativa, se você quiser selecionar a versão atual do seu _shell_ ou para executar um comando em uma versão específica de sua ferramenta, você pode selecionar a versão na variável de ambiente `ASDF_${TOOL}_VERSION`.
O seguinte exemplo executa os testes em um projeto Elixir na versão `1.4.0`.
O formato da versão é o mesmo suportado pelo arquivo `.tool-versions`.
```shell
ASDF_ELIXIR_VERSION=1.4.0 mix test
```
## Resposta do sistema de versão
Para usar o sistema de versão da ferramenta `<name>` inicie um gerenciador de versões do asdf para selecionar a versão na ferramenta do `system`.
Selecione o sistema com `global`, `local` ou `shell`
Set system with either `global`, `local` or `shell` conforme descrito em [Selecionar versão atual](#selecionar-versão-atual).
```shell
asdf local <name> system
# asdf local python system
```
## Verificar a versão atual
```shell
asdf current
# asdf current
# erlang 17.3 (set by /Users/kim/.tool-versions)
# nodejs 6.11.5 (set by /Users/kim/cool-node-project/.tool-versions)
asdf current <name>
# asdf current erlang
# 17.3 (set by /Users/kim/.tool-versions)
```
## Desinstalar versão
```shell
asdf uninstall <name> <version>
# asdf uninstall erlang 17.3
```
## Shims
Quando asdf instala um pacote é criado _shims_ para cada programa executado no pacote do diretório `$ASDF_DATA_DIR/shims` (padrão `~/.asdf/shims`). Esse diretório começa no `$PATH` (pelos `asdf.sh` ou `asdf.fish`) é como o programa instalado é disponibilizado no ambiente do sistema.
Os _shims_ em si são atalhos simples que executam um programa auxiliar `asdf exec` passando o nome do plugin e o caminho para o executável no pacote instalado que o _shim_ está contido.
O `asdf exec` ajuda a determinar a versão do pacote usado (como especificado no arquivo `.tool-versions`, pelo `asdf local ...` ou `asdf global ...`), o final do _path_ do executavél no pacote instalado no diretório (pode ser manipulado pelo `exec-path` no _callback_ do plugin) e o ambiente executado em (também fornecido pelo plugin - `exec-env`) e finalmente executado.
!> Observe que, como este sistema usa chamadas `exec`, qualquer _scripts_ no pacote devem ser fornecidos pelo _shell_, a instancia em execução precisa ser aessado diretamente ao invés do _shim_. Os dois comandos do asdf: `which` e `where` pode ajudar com o retorno do caminho para o pacote instalado:
```shell
# retorna o 'path' da versão atual em execução
source $(asdf which ${PLUGIN})/../script.sh
# retorna o 'path' do pacote instalado no diretório
source $(asdf where ${PLUGIN} $(asdf current ${PLUGIN}))/bin/script.sh
```
### Ignorando _shims_ do asdf
Se por algum motivo você deseja ignorar _shims_ do asdf ou deseja que suas variáveis de ambiente sejam definidas automaticamente ao entrar no diretório do seu projeto, pode ser útil o [asdf-direnv](https://github.com/asdf-community/asdf-direnv). Verifique o README para mais detalhes.

View File

@ -1,17 +0,0 @@
## Créditos
Eu ([@HashNuke](https://github.com/HashNuke)), febre alta, resfriado e tosse.
Copyright 2014 até o final dos tempos ([MIT License](https://github.com/asdf-vm/asdf/blob/master/LICENSE))
## Mantenedores
- [@HashNuke](https://github.com/HashNuke)
- [@danhper](https://github.com/danhper)
- [@Stratus3D](https://github.com/Stratus3D)
- [@vic](https://github.com/vic)
- [@jthegedus](https://github.com/jthegedus)
## Contribuidores
Veja em [lista de contribuidores](https://github.com/asdf-vm/asdf/graphs/contributors) :pray: no GitHub

View File

@ -1,47 +0,0 @@
;(function(win) {
win.EditOnGithubPlugin = {}
function create(docBase, options) {
options = options || {}
title = options.title || 'Edit on github'
customURLs = options.customURLs || {}
var docEditBase = docBase.replace(/\/blob\//, '/edit/')
function editDoc(event, vm) {
var docName = vm.route.file
if (docName) {
var editLink = customURLs[docName] || docEditBase + docName
window.open(editLink)
event.preventDefault()
return false
} else {
return true
}
}
win.EditOnGithubPlugin.editDoc = editDoc
return function(hook, vm) {
win.EditOnGithubPlugin.onClick = function(event) {
EditOnGithubPlugin.editDoc(event, vm)
}
var header = [
'<div style="overflow: auto">',
'<p style="float: right"><a href="',
docBase,
'" target="_blank" onclick="EditOnGithubPlugin.onClick(event)">',
title,
'</a></p>',
'</div>'
].join('')
hook.afterEach(function (html) {
return header + html
})
}
}
win.EditOnGithubPlugin.create = create
}) (window)