c3b3de5f29b72b45393b62d794450ad3a72703a8

Author
Marc Cornellà <marc.cornella@live.com>
Committer
Marc Cornellà <marc.cornella@live.com>
Date

Message

Merge pull request #4956 from RobLoach/asdf

Add asdf version manager plugin

Diff

 1diff --git a/plugins/asdf/README.md b/plugins/asdf/README.md
 2new file mode 100644
 3index 0000000000000000000000000000000000000000..e8aa976bca3f4fe2263e641cee39419435df2430
 4--- /dev/null
 5+++ b/plugins/asdf/README.md
 6@@ -0,0 +1,27 @@
 7+## asdf
 8+
 9+**Maintainer:** [@RobLoach](https://github.com/RobLoach)
10+
11+Adds integration with [asdf](https://github.com/asdf-vm/asdf), the extendable version manager, with support for Ruby, Node.js, Elixir, Erlang and more.
12+
13+### Installation
14+
15+1. Enable the plugin by adding it to your `plugins` definition in `~/.zshrc`.
16+
17+  ```
18+  plugins=(asdf)
19+  ```
20+
21+2. [Install asdf](https://github.com/asdf-vm/asdf#setup) by running the following:
22+  ```
23+  git clone https://github.com/asdf-vm/asdf.git ~/.asdf
24+  ```
25+
26+### Usage
27+
28+See the [asdf usage documentation](https://github.com/asdf-vm/asdf#usage) for information on how to use asdf:
29+
30+```
31+asdf plugin-add nodejs git@github.com:asdf-vm/asdf-nodejs.git
32+asdf install nodejs 5.9.1
33+```
34diff --git a/plugins/asdf/asdf.plugin.zsh b/plugins/asdf/asdf.plugin.zsh
35new file mode 100644
36index 0000000000000000000000000000000000000000..8736d2ff8363cc77227ea70ec121e94b7612b7ee
37--- /dev/null
38+++ b/plugins/asdf/asdf.plugin.zsh
39@@ -0,0 +1,7 @@
40+# Find where asdf should be installed.
41+ASDF_DIR="${ASDF_DIR:-$HOME/.asdf}"
42+
43+# Load asdf, if found.
44+if [ -f $ASDF_DIR/asdf.sh ]; then
45+    . $ASDF_DIR/asdf.sh
46+fi