Created
March 31, 2019 05:34
-
-
Save cmdallas/f85b4dbb006961a61c661bf640e45451 to your computer and use it in GitHub Desktop.
asdf zsh configuration
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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