Skip to content

Instantly share code, notes, and snippets.

@cmdallas
Created March 31, 2019 05:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cmdallas/f85b4dbb006961a61c661bf640e45451 to your computer and use it in GitHub Desktop.
Save cmdallas/f85b4dbb006961a61c661bf640e45451 to your computer and use it in GitHub Desktop.
asdf zsh configuration
# Add this to ~/.zshrc after asdf has been installed
ASDF_DIR="$HOME/.asdf"
ASDF_COMPLETIONS="$ASDF_DIR/completions"
# Add asdf to PATH
#
# if in $PATH, remove, regardless of if it is in the right place (at the front) or not.
# replace all occurrences - ${parameter//pattern/string}
ASDF_BIN="${ASDF_DIR}/bin"
ASDF_USER_SHIMS="${ASDF_DATA_DIR:-$HOME/.asdf}/shims"
[[ ":$PATH:" == *":${ASDF_BIN}:"* ]] && PATH="${PATH//$ASDF_BIN:/}"
[[ ":$PATH:" == *":${ASDF_USER_SHIMS}:"* ]] && PATH="${PATH//$ASDF_USER_SHIMS:/}"
# add to front of $PATH
PATH="${ASDF_BIN}:$PATH"
PATH="${ASDF_USER_SHIMS}:$PATH"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment