From 55457187d18221e76bd12f0fb2cfab65c49b92fb Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Tue, 5 Mar 2019 01:09:01 +0100 Subject: Initial commit --- .oh-my-zsh/plugins/asdf/README.md | 27 +++++++++++++++++++++++++++ .oh-my-zsh/plugins/asdf/asdf.plugin.zsh | 19 +++++++++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 .oh-my-zsh/plugins/asdf/README.md create mode 100644 .oh-my-zsh/plugins/asdf/asdf.plugin.zsh (limited to '.oh-my-zsh/plugins/asdf') diff --git a/.oh-my-zsh/plugins/asdf/README.md b/.oh-my-zsh/plugins/asdf/README.md new file mode 100644 index 0000000..e8aa976 --- /dev/null +++ b/.oh-my-zsh/plugins/asdf/README.md @@ -0,0 +1,27 @@ +## asdf + +**Maintainer:** [@RobLoach](https://github.com/RobLoach) + +Adds integration with [asdf](https://github.com/asdf-vm/asdf), the extendable version manager, with support for Ruby, Node.js, Elixir, Erlang and more. + +### Installation + +1. Enable the plugin by adding it to your `plugins` definition in `~/.zshrc`. + + ``` + plugins=(asdf) + ``` + +2. [Install asdf](https://github.com/asdf-vm/asdf#setup) by running the following: + ``` + git clone https://github.com/asdf-vm/asdf.git ~/.asdf + ``` + +### Usage + +See the [asdf usage documentation](https://github.com/asdf-vm/asdf#usage) for information on how to use asdf: + +``` +asdf plugin-add nodejs git@github.com:asdf-vm/asdf-nodejs.git +asdf install nodejs 5.9.1 +``` diff --git a/.oh-my-zsh/plugins/asdf/asdf.plugin.zsh b/.oh-my-zsh/plugins/asdf/asdf.plugin.zsh new file mode 100644 index 0000000..38b2255 --- /dev/null +++ b/.oh-my-zsh/plugins/asdf/asdf.plugin.zsh @@ -0,0 +1,19 @@ +# Find where asdf should be installed +ASDF_DIR="${ASDF_DIR:-$HOME/.asdf}" +ASDF_COMPLETIONS="$ASDF_DIR/completions" + +# If not found, check for Homebrew package +if [[ ! -f "$ASDF_DIR/asdf.sh" ]] && (( $+commands[brew] )); then + ASDF_DIR="$(brew --prefix asdf)" + ASDF_COMPLETIONS="$ASDF_DIR/etc/bash_completion.d" +fi + +# Load command +if [[ -f "$ASDF_DIR/asdf.sh" ]]; then + . "$ASDF_DIR/asdf.sh" + + # Load completions + if [[ -f "$ASDF_COMPLETIONS/asdf.bash" ]]; then + . "$ASDF_COMPLETIONS/asdf.bash" + fi +fi -- cgit v1.2.3